@@ -24,7 +24,7 @@ import { ViewPane } from 'vs/workbench/browser/parts/views/viewPane';
2424import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet' ;
2525import { Memento , MementoObject } from 'vs/workbench/common/memento' ;
2626import { IViewBadge , IViewDescriptorService , IViewsService } from 'vs/workbench/common/views' ;
27- import { IOverlayWebview , IWebviewService , WebviewContentPurpose } from 'vs/workbench/contrib/webview/browser/webview' ;
27+ import { IOverlayWebview , IWebviewService , WebviewContentPurpose , WebviewOriginStore } from 'vs/workbench/contrib/webview/browser/webview' ;
2828import { WebviewWindowDragMonitor } from 'vs/workbench/contrib/webview/browser/webviewWindowDragMonitor' ;
2929import { IWebviewViewService , WebviewView } from 'vs/workbench/contrib/webviewView/browser/webviewViewService' ;
3030import { IActivityService , NumberBadge } from 'vs/workbench/services/activity/common/activity' ;
@@ -38,6 +38,13 @@ const storageKeys = {
3838
3939export class WebviewViewPane extends ViewPane {
4040
41+ private static _originStore ?: WebviewOriginStore ;
42+
43+ private static getOriginStore ( storageService : IStorageService ) : WebviewOriginStore {
44+ this . _originStore ??= new WebviewOriginStore ( 'webviewViews.origins' , storageService ) ;
45+ return this . _originStore ;
46+ }
47+
4148 private readonly _webview = this . _register ( new MutableDisposable < IOverlayWebview > ( ) ) ;
4249 private readonly _webviewDisposables = this . _register ( new DisposableStore ( ) ) ;
4350 private _activated = false ;
@@ -58,22 +65,22 @@ export class WebviewViewPane extends ViewPane {
5865
5966 constructor (
6067 options : IViewletViewOptions ,
61- @IKeybindingService keybindingService : IKeybindingService ,
62- @IContextMenuService contextMenuService : IContextMenuService ,
6368 @IConfigurationService configurationService : IConfigurationService ,
6469 @IContextKeyService contextKeyService : IContextKeyService ,
65- @IViewDescriptorService viewDescriptorService : IViewDescriptorService ,
70+ @IContextMenuService contextMenuService : IContextMenuService ,
6671 @IInstantiationService instantiationService : IInstantiationService ,
72+ @IKeybindingService keybindingService : IKeybindingService ,
6773 @IOpenerService openerService : IOpenerService ,
68- @IThemeService themeService : IThemeService ,
6974 @ITelemetryService telemetryService : ITelemetryService ,
70- @IStorageService storageService : IStorageService ,
75+ @IThemeService themeService : IThemeService ,
76+ @IViewDescriptorService viewDescriptorService : IViewDescriptorService ,
77+ @IActivityService private readonly activityService : IActivityService ,
7178 @IExtensionService private readonly extensionService : IExtensionService ,
7279 @IProgressService private readonly progressService : IProgressService ,
80+ @IStorageService private readonly storageService : IStorageService ,
81+ @IViewsService private readonly viewService : IViewsService ,
7382 @IWebviewService private readonly webviewService : IWebviewService ,
7483 @IWebviewViewService private readonly webviewViewService : IWebviewViewService ,
75- @IViewsService private readonly viewService : IViewsService ,
76- @IActivityService private activityService : IActivityService
7784 ) {
7885 super ( { ...options , titleMenuId : MenuId . ViewTitle } , keybindingService , contextMenuService , configurationService , contextKeyService , viewDescriptorService , instantiationService , openerService , themeService , telemetryService ) ;
7986 this . extensionId = options . fromExtensionId ;
@@ -167,8 +174,10 @@ export class WebviewViewPane extends ViewPane {
167174 this . _activated = true ;
168175
169176 const webviewId = generateUuid ( ) ;
177+ const origin = WebviewViewPane . getOriginStore ( this . storageService ) . getOrigin ( this . id , this . extensionId ) ;
170178 const webview = this . webviewService . createWebviewOverlay ( {
171179 id : webviewId ,
180+ origin,
172181 providedViewType : this . id ,
173182 options : { purpose : WebviewContentPurpose . WebviewView } ,
174183 contentOptions : { } ,
0 commit comments