chrome-devtools-frontend 1.0.1736236 → 1.0.1738725

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
  2. package/.agents/skills/version-control/SKILL.md +63 -11
  3. package/docs/devtools-protocol.md +3 -1
  4. package/eslint.config.mjs +0 -6
  5. package/front_end/core/host/AidaClient.ts +14 -36
  6. package/front_end/core/host/AidaGcaTranslation.ts +8 -5
  7. package/front_end/core/root/Runtime.ts +0 -5
  8. package/front_end/design_system_tokens.css +1 -0
  9. package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
  10. package/front_end/entrypoints/main/MainImpl.ts +0 -4
  11. package/front_end/generated/SupportedCSSProperties.ts +8 -23
  12. package/front_end/models/ai-utils/AiUtils.ts +1 -5
  13. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
  14. package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
  15. package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
  16. package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
  17. package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
  18. package/front_end/models/trace/EventsSerializer.ts +0 -8
  19. package/front_end/models/workspace/UISourceCode.ts +30 -8
  20. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
  21. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
  22. package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
  23. package/front_end/panels/ai_assistance/components/chatView.css +0 -32
  24. package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
  25. package/front_end/panels/animation/AnimationTimeline.ts +1 -1
  26. package/front_end/panels/animation/animationTimeline.css +5 -3
  27. package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
  28. package/front_end/panels/application/ResourcesPanel.ts +1 -0
  29. package/front_end/panels/application/backgroundServiceView.css +2 -2
  30. package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
  31. package/front_end/panels/application/frameDetailsReportView.css +0 -7
  32. package/front_end/panels/application/indexedDBViews.css +3 -3
  33. package/front_end/panels/application/privateVerificationTokensView.css +6 -0
  34. package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
  35. package/front_end/panels/application/serviceWorkersView.css +2 -2
  36. package/front_end/panels/comments/CommentsPane.ts +1 -1
  37. package/front_end/panels/comments/commentsPane.css +1 -1
  38. package/front_end/panels/common/common.ts +0 -1
  39. package/front_end/panels/console/ConsoleView.ts +11 -1
  40. package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
  41. package/front_end/panels/console/consolePinPane.css +1 -1
  42. package/front_end/panels/console/consoleView.css +5 -4
  43. package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
  44. package/front_end/panels/elements/layoutPane.css +0 -1
  45. package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
  46. package/front_end/panels/emulation/deviceModeView.css +0 -1
  47. package/front_end/panels/issues/issuesTree.css +2 -2
  48. package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
  49. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
  50. package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
  51. package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
  52. package/front_end/panels/layer_viewer/layers3DView.css +0 -4
  53. package/front_end/panels/media/playerListView.css +0 -18
  54. package/front_end/panels/media/playerPropertiesView.css +1 -1
  55. package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
  56. package/front_end/panels/network/RequestPreviewView.ts +182 -63
  57. package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
  58. package/front_end/panels/network/networkConfigView.css +1 -1
  59. package/front_end/panels/network/networkLogView.css +2 -1
  60. package/front_end/panels/network/networkPanel.css +0 -5
  61. package/front_end/panels/network/networkTimingTable.css +1 -1
  62. package/front_end/panels/network/signedExchangeInfoView.css +12 -8
  63. package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
  64. package/front_end/panels/profiler/IsolateSelector.ts +31 -10
  65. package/front_end/panels/profiler/profilesPanel.css +0 -8
  66. package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
  67. package/front_end/panels/screencast/screencastView.css +2 -2
  68. package/front_end/panels/security/SecurityPanel.ts +474 -418
  69. package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
  70. package/front_end/panels/security/lockIcon.css +52 -50
  71. package/front_end/panels/security/mainView.css +149 -145
  72. package/front_end/panels/security/originView.css +117 -115
  73. package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
  74. package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
  75. package/front_end/panels/settings/AISettingsTab.ts +1 -2
  76. package/front_end/panels/settings/SettingsScreen.ts +1 -1
  77. package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
  78. package/front_end/panels/sources/NavigatorView.ts +105 -31
  79. package/front_end/panels/sources/breakpointsView.css +2 -1
  80. package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
  81. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
  82. package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
  83. package/front_end/panels/timeline/TimelinePanel.ts +4 -2
  84. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
  85. package/front_end/panels/timeline/components/networkRequestDetails.css +1 -1
  86. package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
  87. package/front_end/panels/web_audio/webAudio.css +1 -2
  88. package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
  89. package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
  90. package/front_end/panels/whats_new/resources/WNDT.md +6 -6
  91. package/front_end/third_party/chromium/README.chromium +1 -1
  92. package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
  93. package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
  94. package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
  95. package/front_end/ui/components/buttons/button.css +2 -2
  96. package/front_end/ui/components/buttons/floatingButton.css +0 -44
  97. package/front_end/ui/components/icon_button/iconButton.css +1 -1
  98. package/front_end/ui/components/markdown_view/markdownView.css +1 -1
  99. package/front_end/ui/legacy/ContextMenu.ts +7 -5
  100. package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
  101. package/front_end/ui/legacy/InspectorView.ts +5 -1
  102. package/front_end/ui/legacy/PopoverHelper.ts +1 -0
  103. package/front_end/ui/legacy/RootView.ts +9 -3
  104. package/front_end/ui/legacy/SplitWidget.ts +1 -0
  105. package/front_end/ui/legacy/Treeoutline.ts +9 -0
  106. package/front_end/ui/legacy/UIUtils.ts +1 -1
  107. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
  108. package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
  109. package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
  110. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
  111. package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
  112. package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
  113. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -0
  114. package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
  115. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
  116. package/front_end/ui/legacy/filter.css +1 -1
  117. package/front_end/ui/legacy/infobar.css +1 -1
  118. package/front_end/ui/legacy/inspectorCommon.css +2 -2
  119. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
  120. package/front_end/ui/legacy/listWidget.css +2 -7
  121. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  122. package/front_end/ui/legacy/tabbedPane.css +2 -1
  123. package/front_end/ui/legacy/treeoutline.css +3 -2
  124. package/front_end/ui/visual_logging/KnownContextValues.ts +133 -0
  125. package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
  126. package/package.json +1 -1
  127. package/front_end/Images/geminiInDevTools.png +0 -0
  128. package/front_end/Images/geminiInDevTools_2x.png +0 -0
  129. package/front_end/generated/InspectorBackendCommands.ts +0 -1690
  130. package/front_end/generated/protocol-mapping.d.ts +0 -5986
  131. package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
  132. package/front_end/generated/protocol.ts +0 -23364
  133. package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
  134. package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
@@ -113,20 +113,42 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
113
113
  }
114
114
 
115
115
  /**
116
- * Returns the security origin for this source code.
117
- * Prefers the project security origin if available. If the project does not
118
- * define a security origin, derives it from the source code's URL and caches
119
- * the result until the source code is renamed.
116
+ * Returns the security origin for this file, cached until it is renamed.
120
117
  */
121
118
  securityOrigin(): SDK.SecurityOrigin.SecurityOrigin {
119
+ this.#securityOrigin ??= this.#computeSecurityOrigin();
120
+ return this.#securityOrigin;
121
+ }
122
+
123
+ /**
124
+ * Source-map projects use the script's origin, so paths like `webpack://`
125
+ * get that origin too. If a fetchable URL has a different origin, we return
126
+ * an opaque origin. Using the project's origin would let maps without
127
+ * `sourcesContent` fetch cross-origin URLs. Using the URL's origin would let
128
+ * a third-party script match the page's origin and bypass origin locks.
129
+ */
130
+ #computeSecurityOrigin(): SDK.SecurityOrigin.SecurityOrigin {
122
131
  const projectOrigin = this.#project.securityOrigin?.();
123
- if (projectOrigin) {
132
+ if (!projectOrigin) {
133
+ return SDK.SecurityOrigin.SecurityOrigin.create(this.#url);
134
+ }
135
+ if (projectOrigin.isOpaque() || !this.#canFetchExternalResource()) {
124
136
  return projectOrigin;
125
137
  }
126
- if (!this.#securityOrigin) {
127
- this.#securityOrigin = SDK.SecurityOrigin.SecurityOrigin.create(this.#url);
138
+ const urlOrigin = SDK.SecurityOrigin.SecurityOrigin.create(this.#url);
139
+ return urlOrigin.isSameOriginWith(projectOrigin) ? projectOrigin :
140
+ SDK.SecurityOrigin.SecurityOrigin.createUniqueOpaque();
141
+ }
142
+
143
+ #canFetchExternalResource(): boolean {
144
+ const parsed = URL.parse(this.#url);
145
+ // Inline data: URLs cannot fetch external content.
146
+ if (!parsed || parsed.protocol === 'data:') {
147
+ return false;
128
148
  }
129
- return this.#securityOrigin;
149
+ return parsed.protocol === 'blob:' || parsed.protocol === 'filesystem:' ||
150
+ SDK.SecurityOrigin.IMPORTED_ORIGIN_PREFIXES.has(parsed.protocol) || Common.ParsedURL.hasWebSafeScheme(parsed) ||
151
+ Common.ParsedURL.isPrivilegedScheme(parsed);
130
152
  }
131
153
 
132
154
  fullDisplayName(): string {
@@ -182,10 +182,6 @@ const UIStringsNotTranslate = {
182
182
  *@description Placeholder text for the chat UI input.
183
183
  */
184
184
  inputPlaceholderForNoContext: 'Ask AI Assistance',
185
- /**
186
- * @description Placeholder text for the chat UI input with branding Gemini (do not translate)
187
- */
188
- inputPlaceholderForNoContextBranded: 'Ask Gemini',
189
185
  /**
190
186
  * @description Placeholder text for the chat UI input.
191
187
  */
@@ -1322,9 +1318,7 @@ export class AiAssistancePanel extends UI.Panel.Panel {
1322
1318
  }
1323
1319
 
1324
1320
  #getContextlessPlaceholder(): Platform.UIString.LocalizedString {
1325
- return AiAssistanceModel.AiUtils.isGeminiBranding() ?
1326
- lockedString(UIStringsNotTranslate.inputPlaceholderForNoContextBranded) :
1327
- lockedString(UIStringsNotTranslate.inputPlaceholderForNoContext);
1321
+ return lockedString(UIStringsNotTranslate.inputPlaceholderForNoContext);
1328
1322
  }
1329
1323
 
1330
1324
  #getChatInputPlaceholder(): Platform.UIString.LocalizedString {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import * as Common from '../../core/common/common.js';
6
6
  import * as i18n from '../../core/i18n/i18n.js';
7
- import * as Root from '../../core/root/root.js';
7
+ import type * as Root from '../../core/root/root.js';
8
8
  import * as AiAssistanceModel from '../../models/ai-utils/ai-utils.js';
9
9
  import * as UI from '../../ui/legacy/legacy.js';
10
10
  import * as SettingUIRegistration from '../../ui/settings/settings.js';
@@ -35,28 +35,10 @@ const UIStrings = {
35
35
  * the current context.
36
36
  */
37
37
  debugWithAi: 'Debug with AI',
38
- /**
39
- * @description The title of the command menu action for showing the Gemini panel.
40
- */
41
- showGemini: 'Show `Gemini`',
42
- /**
43
- * @description The setting title to enable the Gemini via the settings tab.
44
- */
45
- enableGemini: 'Enable `Gemini`',
46
- /**
47
- * @description Text of a context menu item to redirect to the Gemini panel with the current context.
48
- */
49
- debugWithGemini: 'Debug with `Gemini`',
50
38
  } as const;
51
39
 
52
40
  const str_ = i18n.i18n.registerUIStrings('panels/ai_assistance/ai_assistance-meta.ts', UIStrings);
53
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
54
-
55
- // Host config is initialized after this module executes, so need to lazily select the string.
56
- function i18nAiBrandedString(gemini: string, assistance: string) {
57
- // eslint-disable-next-line @devtools/l10n-i18nString-call-only-with-uistrings
58
- return () => Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled ? i18nString(gemini) : i18nString(assistance);
59
- }
41
+ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
60
42
 
61
43
  function isGeoRestricted(config?: Root.Runtime.HostConfig): boolean {
62
44
  return config?.aidaAvailability?.blockedByGeo === true;
@@ -103,9 +85,8 @@ function isAnyFeatureAvailable(config?: Root.Runtime.HostConfig): boolean {
103
85
  UI.ViewManager.registerViewExtension({
104
86
  location: UI.ViewManager.ViewLocationValues.DRAWER_VIEW,
105
87
  id: 'freestyler',
106
- commandPrompt: i18nAiBrandedString(UIStrings.showGemini, UIStrings.showAiAssistance),
107
- title: () => Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled ? i18n.i18n.lockedString('Gemini') :
108
- i18nString(UIStrings.aiAssistance),
88
+ commandPrompt: i18nLazyString(UIStrings.showAiAssistance),
89
+ title: i18nLazyString(UIStrings.aiAssistance),
109
90
  order: 10,
110
91
  persistence: UI.ViewManager.ViewPersistence.CLOSEABLE,
111
92
  hasToolbar: false,
@@ -118,7 +99,7 @@ UI.ViewManager.registerViewExtension({
118
99
 
119
100
  SettingUIRegistration.SettingUIRegistration.register(AiAssistanceModel.AiUtils.aiAssistanceEnabledSettingDescriptor, {
120
101
  category: Common.Settings.SettingCategory.AI,
121
- title: i18nAiBrandedString(UIStrings.enableGemini, UIStrings.enableAiAssistance),
102
+ title: i18nLazyString(UIStrings.enableAiAssistance),
122
103
  });
123
104
 
124
105
  UI.ActionRegistration.registerActionExtension({
@@ -127,7 +108,7 @@ UI.ActionRegistration.registerActionExtension({
127
108
  return [];
128
109
  },
129
110
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
130
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
111
+ title: i18nLazyString(UIStrings.debugWithAi),
131
112
  configurableBindings: false,
132
113
  async loadActionDelegate() {
133
114
  const AiAssistance = await loadAiAssistanceModule();
@@ -142,7 +123,7 @@ UI.ActionRegistration.registerActionExtension({
142
123
  return [];
143
124
  },
144
125
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
145
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
126
+ title: i18nLazyString(UIStrings.debugWithAi),
146
127
  configurableBindings: false,
147
128
  async loadActionDelegate() {
148
129
  const AiAssistance = await loadAiAssistanceModule();
@@ -158,7 +139,7 @@ UI.ActionRegistration.registerActionExtension({
158
139
  return [];
159
140
  },
160
141
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
161
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
142
+ title: i18nLazyString(UIStrings.debugWithAi),
162
143
  configurableBindings: false,
163
144
  async loadActionDelegate() {
164
145
  const AiAssistance = await loadAiAssistanceModule();
@@ -174,7 +155,7 @@ UI.ActionRegistration.registerActionExtension({
174
155
  return [];
175
156
  },
176
157
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
177
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
158
+ title: i18nLazyString(UIStrings.debugWithAi),
178
159
  configurableBindings: false,
179
160
  async loadActionDelegate() {
180
161
  const AiAssistance = await loadAiAssistanceModule();
@@ -190,7 +171,7 @@ UI.ActionRegistration.registerActionExtension({
190
171
  return [];
191
172
  },
192
173
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
193
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
174
+ title: i18nLazyString(UIStrings.debugWithAi),
194
175
  configurableBindings: false,
195
176
  async loadActionDelegate() {
196
177
  const AiAssistance = await loadAiAssistanceModule();
@@ -206,7 +187,7 @@ UI.ActionRegistration.registerActionExtension({
206
187
  return [];
207
188
  },
208
189
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
209
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
190
+ title: i18nLazyString(UIStrings.debugWithAi),
210
191
  configurableBindings: false,
211
192
  async loadActionDelegate() {
212
193
  const AiAssistance = await loadAiAssistanceModule();
@@ -222,7 +203,7 @@ UI.ActionRegistration.registerActionExtension({
222
203
  return [];
223
204
  },
224
205
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
225
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
206
+ title: i18nLazyString(UIStrings.debugWithAi),
226
207
  configurableBindings: false,
227
208
  async loadActionDelegate() {
228
209
  const AiAssistance = await loadAiAssistanceModule();
@@ -237,7 +218,7 @@ UI.ActionRegistration.registerActionExtension({
237
218
  return [];
238
219
  },
239
220
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
240
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
221
+ title: i18nLazyString(UIStrings.debugWithAi),
241
222
  configurableBindings: false,
242
223
  async loadActionDelegate() {
243
224
  const AiAssistance = await loadAiAssistanceModule();
@@ -252,7 +233,7 @@ UI.ActionRegistration.registerActionExtension({
252
233
  return [];
253
234
  },
254
235
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
255
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
236
+ title: i18nLazyString(UIStrings.debugWithAi),
256
237
  configurableBindings: false,
257
238
  async loadActionDelegate() {
258
239
  const AiAssistance = await loadAiAssistanceModule();
@@ -268,7 +249,7 @@ UI.ActionRegistration.registerActionExtension({
268
249
  return [];
269
250
  },
270
251
  category: UI.ActionRegistration.ActionCategory.GLOBAL,
271
- title: i18nAiBrandedString(UIStrings.debugWithGemini, UIStrings.debugWithAi),
252
+ title: i18nLazyString(UIStrings.debugWithAi),
272
253
  configurableBindings: false,
273
254
  async loadActionDelegate() {
274
255
  const AiAssistance = await loadAiAssistanceModule();
@@ -44,10 +44,6 @@ const UIStringsNotTranslate = {
44
44
  * @description Text for the empty state of the AI assistance panel.
45
45
  */
46
46
  emptyStateText: 'How can I help you?',
47
- /**
48
- * @description Text for the empty state of the Gemini panel.
49
- */
50
- emptyStateTextGemini: 'Where should we start?',
51
47
  } as const;
52
48
 
53
49
  const lockedString = i18n.i18n.lockedString;
@@ -134,11 +130,6 @@ function findStepAwaitingApproval(messages: Message[]): Step|undefined {
134
130
  }
135
131
 
136
132
  const DEFAULT_VIEW: View = (input, output, target) => {
137
- const chatUiClasses = classMap({
138
- 'chat-ui': true,
139
- gemini: AiAssistanceModel.AiUtils.isGeminiBranding(),
140
- });
141
-
142
133
  const awaitingApprovalStep = findStepAwaitingApproval(input.messages);
143
134
 
144
135
  const inputWidgetClasses = classMap({
@@ -151,7 +142,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
151
142
  render(html`
152
143
  <style>${chatViewStyles}</style>
153
144
  <style>${permissionPromptStyles}</style>
154
- <div class=${chatUiClasses}>
145
+ <div class="chat-ui">
155
146
  <main @scroll=${input.handleScroll} ${ref(element => { output.mainElement = element as HTMLElement; } )}>
156
147
  ${input.messages.length > 0 ? html`
157
148
  <div class="messages-container" ${ref(input.handleMessageContainerRef)}>
@@ -187,12 +178,7 @@ const DEFAULT_VIEW: View = (input, output, target) => {
187
178
  name="smart-assistant"
188
179
  ></devtools-icon>
189
180
  </div>
190
- ${AiAssistanceModel.AiUtils.isGeminiBranding() ?
191
- html`
192
- <h1 class='greeting'>Hello</h1>
193
- <p class='cta'>${lockedString(UIStringsNotTranslate.emptyStateTextGemini)}</p>
194
- ` : html`<h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>`
195
- }
181
+ <h1>${lockedString(UIStringsNotTranslate.emptyStateText)}</h1>
196
182
  </div>
197
183
  <div class="empty-state-content">
198
184
  ${input.emptyStateSuggestions.map(({title, jslogContext}) => {
@@ -133,38 +133,6 @@ main {
133
133
  }
134
134
  }
135
135
 
136
- .gemini {
137
- .empty-state-container {
138
- padding: var(--sys-size-8);
139
- }
140
-
141
- .empty-state-container .icon {
142
- display: none;
143
- }
144
-
145
- .empty-state-container .header {
146
- align-items: flex-start;
147
- line-height: var(--sys-size-4);
148
- }
149
-
150
- .empty-state-content {
151
- align-items: flex-start
152
- }
153
-
154
- .empty-state-container .greeting {
155
- font-size: var(--sys-size-10);
156
- color: var(--sys-color-primary);
157
- }
158
-
159
- .empty-state-container .cta {
160
- font-size: var(--sys-size-10);
161
- }
162
-
163
- main {
164
- align-items: flex-start;
165
- }
166
- }
167
-
168
136
  .change-summary {
169
137
  background-color: var(--sys-color-surface3);
170
138
  border-radius: var(--sys-shape-corner-medium-small);
@@ -20,7 +20,7 @@
20
20
  justify-content: space-between;
21
21
  align-items: center;
22
22
  padding: 0 var(--sys-size-5);
23
- height: 35px;
23
+ height: var(--sys-size-13);
24
24
  border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
25
25
  flex-shrink: 0;
26
26
  }
@@ -106,7 +106,7 @@ const {render, html, Directives: {classMap}} = Lit;
106
106
  const nodeUIsByNode = new WeakMap<SDK.DOMModel.DOMNode, NodeUI>();
107
107
 
108
108
  const MIN_TIMELINE_CONTROLS_WIDTH = 120;
109
- const DEFAULT_TIMELINE_CONTROLS_WIDTH = 150;
109
+ const DEFAULT_TIMELINE_CONTROLS_WIDTH = 144;
110
110
  const MAX_TIMELINE_CONTROLS_WIDTH = 720;
111
111
 
112
112
  const ANIMATION_EXPLANATION_URL =
@@ -7,7 +7,7 @@
7
7
  :host {
8
8
  overflow: hidden;
9
9
 
10
- --timeline-controls-width: 150px;
10
+ --timeline-controls-width: var(--sys-size-22);
11
11
  }
12
12
 
13
13
  :host(.suspended) :is(
@@ -419,7 +419,7 @@ text.animation-timeline-grid-label {
419
419
  .animation-paused::after {
420
420
  content: '';
421
421
  background: var(--sys-color-cdt-base-container);
422
- width: 7px;
422
+ width: var(--sys-size-4);
423
423
  height: var(--sys-size-9);
424
424
  border-radius: var(--sys-size-2);
425
425
  margin: var(--sys-size-2);
@@ -542,7 +542,9 @@ text.animation-timeline-grid-label {
542
542
  width: var(--sys-size-4);
543
543
  height: 100%;
544
544
  left: var(--timeline-controls-width);
545
- top: 104px;
545
+ /* Position below the 28px top toolbar (--sys-size-12), 48px preview
546
+ buffer (--sys-size-16), and 28px timeline header (--sys-size-12). */
547
+ top: calc(2 * var(--sys-size-12) + var(--sys-size-16));
546
548
  z-index: 3;
547
549
  /* We put this a bit to the left of the line to allow dragging
548
550
  the delay point of the keyframes */
@@ -2,6 +2,7 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
+ import '../../ui/kit/kit.js';
5
6
  import '../../ui/legacy/components/data_grid/data_grid.js';
6
7
 
7
8
  import * as Common from '../../core/common/common.js';
@@ -9,6 +10,7 @@ import * as i18n from '../../core/i18n/i18n.js';
9
10
  import * as Platform from '../../core/platform/platform.js';
10
11
  import * as SDK from '../../core/sdk/sdk.js';
11
12
  import type * as Protocol from '../../generated/protocol.js';
13
+ import * as Buttons from '../../ui/components/buttons/buttons.js';
12
14
  import * as UI from '../../ui/legacy/legacy.js';
13
15
  import {Directives, html, render, type TemplateResult} from '../../ui/lit/lit.js';
14
16
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
@@ -34,6 +36,14 @@ const UIStrings = {
34
36
  * @description Empty state message when no private verification tokens match the current origin.
35
37
  */
36
38
  noPrivateVerificationTokens: 'No private verification tokens for this origin',
39
+ /**
40
+ * @description Text to clear everything.
41
+ */
42
+ clearAll: 'Clear all',
43
+ /**
44
+ * @description Tooltip text that appears when hovering over the delete button in the toolbar.
45
+ */
46
+ deleteSelected: 'Delete selected',
37
47
  /**
38
48
  * @description Column header for Token ID.
39
49
  */
@@ -80,6 +90,11 @@ export interface TokenRow {
80
90
 
81
91
  export interface ViewInput {
82
92
  tokens: TokenRow[];
93
+ selectedTokenId: string|null;
94
+ onSelect: (tokenId: string) => void;
95
+ onDeselect: () => void;
96
+ onDeleteAll: () => void;
97
+ onDeleteToken: (tokenId: string) => void;
83
98
  }
84
99
 
85
100
  function renderView(input: ViewInput): TemplateResult {
@@ -87,9 +102,27 @@ function renderView(input: ViewInput): TemplateResult {
87
102
  // clang-format off
88
103
  return html`
89
104
  <div class="pvt-view" jslog=${VisualLogging.pane('private-verification-tokens')}>
105
+ <devtools-toolbar class="pvt-toolbar" jslog=${VisualLogging.toolbar()}>
106
+ <devtools-button class="clear-all-button"
107
+ .disabled=${!hasTokens}
108
+ .iconName=${'clear'}
109
+ .jslogContext=${'clear-all'}
110
+ .title=${i18nString(UIStrings.clearAll)}
111
+ .variant=${Buttons.Button.Variant.TOOLBAR}
112
+ @click=${input.onDeleteAll}></devtools-button>
113
+ <devtools-button class="delete-selected-button"
114
+ .disabled=${!input.selectedTokenId}
115
+ .iconName=${'bin'}
116
+ .jslogContext=${'delete-selected'}
117
+ .title=${i18nString(UIStrings.deleteSelected)}
118
+ .variant=${Buttons.Button.Variant.TOOLBAR}
119
+ @click=${() => input.selectedTokenId && input.onDeleteToken(input.selectedTokenId)}>
120
+ </devtools-button>
121
+ </devtools-toolbar>
90
122
  <div class="table-container">
91
123
  ${hasTokens ? html`
92
- <devtools-data-grid striped inline>
124
+ <devtools-data-grid striped inline deletable
125
+ @deselect=${input.onDeselect}>
93
126
  <table>
94
127
  <tr>
95
128
  <th id="issuer" weight="6" sortable>${i18nString(UIStrings.issuer)}</th>
@@ -103,7 +136,9 @@ function renderView(input: ViewInput): TemplateResult {
103
136
  <th id="token" weight="2">${i18nString(UIStrings.tokenPayload)}</th>
104
137
  </tr>
105
138
  ${repeat(input.tokens, token => token.id, token => html`
106
- <tr>
139
+ <tr ?selected=${input.selectedTokenId === token.id}
140
+ @select=${() => input.onSelect(token.id)}
141
+ @delete=${() => input.onDeleteToken(token.id)}>
107
142
  <td>${token.issuerOrigin}</td>
108
143
  <td>${token.isIssuer}</td>
109
144
  <td>${token.isRedeemer}</td>
@@ -141,6 +176,9 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
141
176
  export class PrivateVerificationTokensView extends UI.Widget.VBox implements
142
177
  SDK.TargetManager.SDKModelObserver<SDK.PrivateVerificationTokensModel.PrivateVerificationTokensModel> {
143
178
  #model: SDK.PrivateVerificationTokensModel.PrivateVerificationTokensModel|null = null;
179
+ #tokens: TokenRow[] = [];
180
+ #fetchGeneration = 0;
181
+ #selectedTokenId: string|null = null;
144
182
  #view: View;
145
183
 
146
184
  constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
@@ -153,20 +191,23 @@ export class PrivateVerificationTokensView extends UI.Widget.VBox implements
153
191
  const targetManager = SDK.TargetManager.TargetManager.instance();
154
192
  targetManager.observeModels(SDK.PrivateVerificationTokensModel.PrivateVerificationTokensModel, this,
155
193
  {scoped: true});
156
- targetManager.addEventListener(SDK.TargetManager.Events.INSPECTED_URL_CHANGED, this.requestUpdate, this);
194
+ targetManager.addEventListener(SDK.TargetManager.Events.INSPECTED_URL_CHANGED, this.#onTokensChanged, this);
157
195
  targetManager.addModelListener(SDK.SecurityOriginManager.SecurityOriginManager,
158
- SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, this.requestUpdate, this,
159
- {scoped: true});
160
- this.requestUpdate();
196
+ SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, this.#onTokensChanged,
197
+ this, {scoped: true});
198
+ // modelAdded() already triggers a refresh when a model is available.
199
+ if (!this.#model) {
200
+ this.#onTokensChanged();
201
+ }
161
202
  }
162
203
 
163
204
  override willHide(): void {
164
205
  super.willHide();
165
206
  const targetManager = SDK.TargetManager.TargetManager.instance();
166
207
  targetManager.unobserveModels(SDK.PrivateVerificationTokensModel.PrivateVerificationTokensModel, this);
167
- targetManager.removeEventListener(SDK.TargetManager.Events.INSPECTED_URL_CHANGED, this.requestUpdate, this);
208
+ targetManager.removeEventListener(SDK.TargetManager.Events.INSPECTED_URL_CHANGED, this.#onTokensChanged, this);
168
209
  targetManager.removeModelListener(SDK.SecurityOriginManager.SecurityOriginManager,
169
- SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, this.requestUpdate,
210
+ SDK.SecurityOriginManager.Events.MainSecurityOriginChanged, this.#onTokensChanged,
170
211
  this);
171
212
  if (this.#model) {
172
213
  this.modelRemoved(this.#model);
@@ -182,8 +223,8 @@ export class PrivateVerificationTokensView extends UI.Widget.VBox implements
182
223
  }
183
224
  this.#model = model;
184
225
  model.setTracking(true);
185
- model.addEventListener(SDK.PrivateVerificationTokensModel.Events.TOKENS_UPDATED, this.requestUpdate, this);
186
- this.requestUpdate();
226
+ model.addEventListener(SDK.PrivateVerificationTokensModel.Events.TOKENS_UPDATED, this.#onTokensChanged, this);
227
+ this.#onTokensChanged();
187
228
  }
188
229
 
189
230
  modelRemoved(model: SDK.PrivateVerificationTokensModel.PrivateVerificationTokensModel): void {
@@ -191,30 +232,77 @@ export class PrivateVerificationTokensView extends UI.Widget.VBox implements
191
232
  return;
192
233
  }
193
234
  model.setTracking(false);
194
- model.removeEventListener(SDK.PrivateVerificationTokensModel.Events.TOKENS_UPDATED, this.requestUpdate, this);
235
+ model.removeEventListener(SDK.PrivateVerificationTokensModel.Events.TOKENS_UPDATED, this.#onTokensChanged, this);
195
236
  this.#model = null;
237
+ this.#onTokensChanged();
238
+ }
239
+
240
+ #onTokensChanged(): void {
241
+ void this.#refreshTokens();
242
+ }
243
+
244
+ /**
245
+ * Fetches tokens from the backend and caches them, so that local view state
246
+ * changes (such as selection) re-render without additional CDP round-trips.
247
+ * Responses from superseded fetches are discarded.
248
+ */
249
+ async #refreshTokens(): Promise<void> {
250
+ const generation = ++this.#fetchGeneration;
251
+ const tokens = await this.#fetchTokens();
252
+ if (generation !== this.#fetchGeneration) {
253
+ return;
254
+ }
255
+ this.#tokens = tokens;
256
+ if (this.#selectedTokenId && !tokens.some(token => token.id === this.#selectedTokenId)) {
257
+ this.#selectedTokenId = null;
258
+ }
259
+ this.requestUpdate();
196
260
  }
197
261
 
198
- override async performUpdate(signal?: AbortSignal): Promise<void> {
262
+ async #fetchTokens(): Promise<TokenRow[]> {
199
263
  const model = this.#model;
200
- let tokens: TokenRow[] = [];
201
- if (model) {
202
- const currentOrigin = getInspectedOrigin(model.target());
203
- if (currentOrigin) {
204
- const [rawTokens, configs] = await Promise.all([model.getTokens(), model.getIssuerConfigs()]);
205
- // The widget may have been hidden, the model swapped, or a newer update
206
- // requested while the CDP calls were in flight.
207
- if (signal?.aborted || this.#model !== model) {
208
- return;
209
- }
210
- tokens = toTokenRows(rawTokens, configs, currentOrigin);
211
- }
264
+ if (!model) {
265
+ return [];
266
+ }
267
+ const currentOrigin = getInspectedOrigin(model.target());
268
+ if (!currentOrigin) {
269
+ return [];
212
270
  }
271
+ const [rawTokens, configs] = await Promise.all([model.getTokens(), model.getIssuerConfigs()]);
272
+ return toTokenRows(rawTokens, configs, currentOrigin);
273
+ }
274
+
275
+ override performUpdate(): void {
276
+ this.#view({
277
+ tokens: this.#tokens,
278
+ selectedTokenId: this.#selectedTokenId,
279
+ onSelect: tokenId => {
280
+ this.#selectedTokenId = tokenId;
281
+ this.requestUpdate();
282
+ },
283
+ onDeselect: () => {
284
+ this.#selectedTokenId = null;
285
+ this.requestUpdate();
286
+ },
287
+ onDeleteAll: () => void this.#clearAllTokensHandler(),
288
+ onDeleteToken: tokenId => void this.#deleteTokenHandler(tokenId),
289
+ },
290
+ undefined, this.contentElement);
291
+ }
213
292
 
214
- if (signal?.aborted) {
293
+ async #clearAllTokensHandler(): Promise<void> {
294
+ const model = this.#model;
295
+ if (!model) {
215
296
  return;
216
297
  }
217
- this.#view({tokens}, undefined, this.contentElement);
298
+ const issuers = new Set(this.#tokens.map(token => token.issuerOrigin));
299
+ await Promise.all([...issuers].map(issuerOrigin => model.clearTokens(issuerOrigin)));
300
+ await this.#refreshTokens();
301
+ }
302
+
303
+ async #deleteTokenHandler(tokenId: string): Promise<void> {
304
+ await this.#model?.deleteToken(tokenId);
305
+ await this.#refreshTokens();
218
306
  }
219
307
  }
220
308
 
@@ -1,6 +1,7 @@
1
1
  // Copyright 2017 The Chromium Authors
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
+ /* eslint-disable @devtools/no-imperative-dom-api */
4
5
 
5
6
  import '../../ui/legacy/legacy.js';
6
7
 
@@ -35,8 +35,8 @@
35
35
  }
36
36
 
37
37
  .background-service-metadata {
38
- padding-left: 5px;
39
- padding-top: 10px;
38
+ padding-left: var(--sys-size-3);
39
+ padding-top: var(--sys-size-5);
40
40
  }
41
41
 
42
42
  .background-service-metadata-entry {
@@ -30,10 +30,6 @@
30
30
  font-size: inherit;
31
31
  }
32
32
 
33
- .policies-list {
34
- padding-top: 3px;
35
- }
36
-
37
33
  .permissions-row {
38
34
  display: flex;
39
35
  line-height: 22px;
@@ -100,13 +100,6 @@ devtools-button.help-button {
100
100
  font-weight: bold;
101
101
  }
102
102
 
103
- .inline-icon {
104
- margin-bottom: -5px;
105
- width: 18px;
106
- height: 18px;
107
- vertical-align: baseline;
108
- }
109
-
110
103
  @media (forced-colors: active) {
111
104
  .link,
112
105
  .devtools-link {
@@ -47,9 +47,9 @@
47
47
  }
48
48
 
49
49
  .object-store-summary-bar {
50
- flex: 0 0 27px;
51
- line-height: 27px;
52
- padding-left: 5px;
50
+ flex: 0 0 var(--sys-size-11);
51
+ line-height: var(--sys-size-11);
52
+ padding-left: var(--sys-size-3);
53
53
  background-color: var(--sys-color-cdt-base-container);
54
54
  border-top: var(--sys-size-1) solid var(--sys-color-divider);
55
55
  white-space: nowrap;
@@ -19,6 +19,12 @@
19
19
  overflow: hidden;
20
20
  }
21
21
 
22
+ .pvt-toolbar {
23
+ border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
24
+ background-color: var(--sys-color-cdt-base-container);
25
+ flex: none;
26
+ }
27
+
22
28
  .table-container {
23
29
  display: flex;
24
30
  flex-direction: column;
@@ -100,7 +100,7 @@
100
100
  }
101
101
 
102
102
  table.service-worker-update-timing-table > tbody > tr.service-worker-update-timing-table-header > td {
103
- border-top: 5px solid transparent;
103
+ border-top: var(--sys-size-3) solid transparent;
104
104
  color: var(--sys-color-token-subtle);
105
105
  }
106
106