@@ -24,7 +24,7 @@ import { ViewPane } from 'vs/workbench/browser/parts/views/viewPane';
24
24
import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet' ;
25
25
import { Memento , MementoObject } from 'vs/workbench/common/memento' ;
26
26
import { 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' ;
28
28
import { WebviewWindowDragMonitor } from 'vs/workbench/contrib/webview/browser/webviewWindowDragMonitor' ;
29
29
import { IWebviewViewService , WebviewView } from 'vs/workbench/contrib/webviewView/browser/webviewViewService' ;
30
30
import { IActivityService , NumberBadge } from 'vs/workbench/services/activity/common/activity' ;
@@ -38,6 +38,13 @@ const storageKeys = {
38
38
39
39
export class WebviewViewPane extends ViewPane {
40
40
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
+
41
48
private readonly _webview = this . _register ( new MutableDisposable < IOverlayWebview > ( ) ) ;
42
49
private readonly _webviewDisposables = this . _register ( new DisposableStore ( ) ) ;
43
50
private _activated = false ;
@@ -58,22 +65,22 @@ export class WebviewViewPane extends ViewPane {
58
65
59
66
constructor (
60
67
options : IViewletViewOptions ,
61
- @IKeybindingService keybindingService : IKeybindingService ,
62
- @IContextMenuService contextMenuService : IContextMenuService ,
63
68
@IConfigurationService configurationService : IConfigurationService ,
64
69
@IContextKeyService contextKeyService : IContextKeyService ,
65
- @IViewDescriptorService viewDescriptorService : IViewDescriptorService ,
70
+ @IContextMenuService contextMenuService : IContextMenuService ,
66
71
@IInstantiationService instantiationService : IInstantiationService ,
72
+ @IKeybindingService keybindingService : IKeybindingService ,
67
73
@IOpenerService openerService : IOpenerService ,
68
- @IThemeService themeService : IThemeService ,
69
74
@ITelemetryService telemetryService : ITelemetryService ,
70
- @IStorageService storageService : IStorageService ,
75
+ @IThemeService themeService : IThemeService ,
76
+ @IViewDescriptorService viewDescriptorService : IViewDescriptorService ,
77
+ @IActivityService private readonly activityService : IActivityService ,
71
78
@IExtensionService private readonly extensionService : IExtensionService ,
72
79
@IProgressService private readonly progressService : IProgressService ,
80
+ @IStorageService private readonly storageService : IStorageService ,
81
+ @IViewsService private readonly viewService : IViewsService ,
73
82
@IWebviewService private readonly webviewService : IWebviewService ,
74
83
@IWebviewViewService private readonly webviewViewService : IWebviewViewService ,
75
- @IViewsService private readonly viewService : IViewsService ,
76
- @IActivityService private activityService : IActivityService
77
84
) {
78
85
super ( { ...options , titleMenuId : MenuId . ViewTitle } , keybindingService , contextMenuService , configurationService , contextKeyService , viewDescriptorService , instantiationService , openerService , themeService , telemetryService ) ;
79
86
this . extensionId = options . fromExtensionId ;
@@ -167,8 +174,10 @@ export class WebviewViewPane extends ViewPane {
167
174
this . _activated = true ;
168
175
169
176
const webviewId = generateUuid ( ) ;
177
+ const origin = WebviewViewPane . getOriginStore ( this . storageService ) . getOrigin ( this . id , this . extensionId ) ;
170
178
const webview = this . webviewService . createWebviewOverlay ( {
171
179
id : webviewId ,
180
+ origin,
172
181
providedViewType : this . id ,
173
182
options : { purpose : WebviewContentPurpose . WebviewView } ,
174
183
contentOptions : { } ,
0 commit comments