Skip to content

Commit 18a4c98

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
Enterprise-policy dependent UIStrings for AI Settings and console
insights Bug: 372196790 Change-Id: I4786c26938039a13202744ac3fbc9a12e3796c47 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6207654 Reviewed-by: Alex Rudenko <[email protected]> Auto-Submit: Wolfgang Beyer <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent d45fb6c commit 18a4c98

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

front_end/panels/explain/components/ConsoleInsight.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import * as Common from '../../../core/common/common.js';
88
import * as Host from '../../../core/host/host.js';
99
import * as i18n from '../../../core/i18n/i18n.js';
1010
import type * as Platform from '../../../core/platform/platform.js';
11+
import * as Root from '../../../core/root/root.js';
1112
import * as Marked from '../../../third_party/marked/marked.js';
1213
import * as Buttons from '../../../ui/components/buttons/buttons.js';
1314
import type * as IconButton from '../../../ui/components/icon_button/icon_button.js';
@@ -751,6 +752,9 @@ export class ConsoleInsight extends HTMLElement {
751752

752753
#renderMain(): LitHtml.TemplateResult {
753754
const jslog = `${VisualLogging.section(this.#state.type).track({resize: true})}`;
755+
const noLogging = Common.Settings.Settings.instance().getHostConfig().aidaAvailability?.enterprisePolicyValue ===
756+
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
757+
754758
// clang-format off
755759
switch (this.#state.type) {
756760
case State.LOADING:
@@ -808,7 +812,11 @@ export class ConsoleInsight extends HTMLElement {
808812
} as IconButton.Icon.IconData}>
809813
</devtools-icon>
810814
</div>
811-
<div>The console message, associated stack trace, related source code, and the associated network headers are sent to Google to generate explanations. This data may be seen by human reviewers to improve this feature. Avoid sharing sensitive or personal information.</div>
815+
<div>The console message, associated stack trace, related source code, and the associated network headers are sent to Google to generate explanations.
816+
${noLogging
817+
? 'The content you submit and that is generated by this feature will not be used to improve Google’s AI models.'
818+
: 'This data may be seen by human reviewers to improve this feature. Avoid sharing sensitive or personal information.'}
819+
</div>
812820
<div>
813821
<devtools-icon .data=${{
814822
iconName: 'policy',
@@ -890,9 +898,15 @@ export class ConsoleInsight extends HTMLElement {
890898
}
891899

892900
#renderDisclaimer(): LitHtml.LitTemplate {
901+
const noLogging = Common.Settings.Settings.instance().getHostConfig().aidaAvailability?.enterprisePolicyValue ===
902+
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
903+
893904
// clang-format off
894905
return html`<span>
895-
AI tools may generate inaccurate info that doesn't represent Google's views. Data sent to Google may be seen by human reviewers to improve this feature.
906+
AI tools may generate inaccurate info that doesn't represent Google's views.
907+
${noLogging
908+
? 'The content you submit and that is generated by this feature will not be used to improve Google’s AI models.'
909+
: 'Data sent to Google may be seen by human reviewers to improve this feature.'}
896910
<button class="link" role="link" @click=${() => UI.ViewManager.ViewManager.instance().showView('chrome-ai')}
897911
jslog=${VisualLogging.action('open-ai-settings').track({click: true})}
898912
>Open settings</button>

front_end/panels/settings/AISettingsTab.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ const UIStrings = {
8383
*/
8484
consoleInsightsSendsData:
8585
'The console message, associated stack trace, related source code, and the associated network headers are sent to Google to generate explanations. This data may be seen by human reviewers to improve this feature.',
86+
/**
87+
*@description Explainer for which data is being sent by the console insights feature
88+
*/
89+
consoleInsightsSendsDataNoLogging:
90+
'The console message, associated stack trace, related source code, and the associated network headers are sent to Google to generate explanations. This data will not be used to improve Google’s AI models.',
8691
/**
8792
*@description Reference to the terms of service and privacy notice
8893
*@example {Google Terms of Service} PH1
@@ -136,6 +141,11 @@ const UIStrings = {
136141
*/
137142
freestylerSendsData:
138143
'Any data the inspected page can access via Web APIs, network requests, files, and performance traces are sent to Google to generate explanations. This data may be seen by human reviewers to improve this feature. Don’t use on pages with personal or sensitive information.',
144+
/**
145+
*@description Explainer for which data is being sent by the AI assistance feature
146+
*/
147+
freestylerSendsDataNoLogging:
148+
'Any data the inspected page can access via Web APIs, network requests, files, and performance traces are sent to Google to generate explanations. This data will not be used to improve Google’s AI models.',
139149
/**
140150
*@description Label for a link to the terms of service
141151
*/
@@ -410,6 +420,8 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
410420
open: this.#isConsoleInsightsSettingExpanded,
411421
};
412422
const tabindex = this.#isConsoleInsightsSettingExpanded ? '0' : '-1';
423+
const noLogging = Common.Settings.Settings.instance().getHostConfig().aidaAvailability?.enterprisePolicyValue ===
424+
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
413425

414426
// Disabled until https://crbug.com/1079231 is fixed.
415427
// clang-format off
@@ -454,7 +466,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
454466
${this.#renderSettingItem('lightbulb', i18nString(UIStrings.explainConsole))}
455467
${this.#renderSettingItem('code', i18nString(UIStrings.receiveSuggestions))}
456468
<h3 class="expansion-grid-whole-row">${i18nString(UIStrings.thingsToConsider)}</h3>
457-
${this.#renderSettingItem('google', i18nString(UIStrings.consoleInsightsSendsData))}
469+
${this.#renderSettingItem('google', noLogging ? i18nString(UIStrings.consoleInsightsSendsDataNoLogging) : i18nString(UIStrings.consoleInsightsSendsData))}
458470
<div class="expansion-grid-whole-row">
459471
<x-link
460472
href="https://goo.gle/devtools-console-messages-ai"
@@ -480,6 +492,8 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
480492
open: this.#isAiAssistanceSettingExpanded,
481493
};
482494
const tabindex = this.#isAiAssistanceSettingExpanded ? '0' : '-1';
495+
const noLogging = Common.Settings.Settings.instance().getHostConfig().aidaAvailability?.enterprisePolicyValue ===
496+
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
483497

484498
// Disabled until https://crbug.com/1079231 is fixed.
485499
// clang-format off
@@ -524,7 +538,7 @@ export class AISettingsTab extends LegacyWrapper.LegacyWrapper.WrappableComponen
524538
${this.#renderSettingItem('info', this.#getAiAssistanceSettingInfo())}
525539
${this.#renderSettingItem('pen-spark', i18nString(UIStrings.receiveStylingSuggestions))}
526540
<h3 class="expansion-grid-whole-row">${i18nString(UIStrings.thingsToConsider)}</h3>
527-
${this.#renderSettingItem('google', i18nString(UIStrings.freestylerSendsData))}
541+
${this.#renderSettingItem('google', noLogging ? i18nString(UIStrings.freestylerSendsDataNoLogging) : i18nString(UIStrings.freestylerSendsData))}
528542
<div class="expansion-grid-whole-row">
529543
<x-link
530544
href="https://goo.gle/devtools-ai-assistance"

0 commit comments

Comments
 (0)