Skip to content

Commit 628aa89

Browse files
wolfibDevtools-frontend LUCI CQ
authored andcommitted
[Console insights] Add 'Sign in' button
The 'Update Settings' button, which allowed enabling sync, is not needed anymore. Replace it with a 'Sign in' button instead. Fixed: 376851386 Change-Id: I206b1d5b56dec1cd5756f27265ede57bb91e6910 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5987920 Reviewed-by: Alex Rudenko <[email protected]> Commit-Queue: Wolfgang Beyer <[email protected]>
1 parent a1554c1 commit 628aa89

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

front_end/panels/explain/components/ConsoleInsight.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ 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 SDK from '../../../core/sdk/sdk.js';
1211
import * as Marked from '../../../third_party/marked/marked.js';
1312
import * as Buttons from '../../../ui/components/buttons/buttons.js';
1413
import type * as IconButton from '../../../ui/components/icon_button/icon_button.js';
@@ -95,9 +94,9 @@ const UIStrings = {
9594
*/
9695
notLoggedIn: 'This feature is only available when you sign into Chrome with your Google account.',
9796
/**
98-
* @description The title of the button that opens Chrome settings.
97+
* @description The title of a button which opens the Chrome SignIn page.
9998
*/
100-
updateSettings: 'Update Settings',
99+
signIn: 'Sign in',
101100
/**
102101
* @description The header shown when the internet connection is not
103102
* available.
@@ -168,7 +167,7 @@ const CODE_SNIPPET_WARNING_URL = 'https://support.google.com/legal/answer/135054
168167
const LEARNMORE_URL = 'https://goo.gle/devtools-console-messages-ai' as Platform.DevToolsPath.UrlString;
169168
const REPORT_URL = 'https://support.google.com/legal/troubleshooter/1114905?hl=en#ts=1115658%2C13380504' as
170169
Platform.DevToolsPath.UrlString;
171-
const CHROME_SETTINGS_URL = 'chrome://settings' as Platform.DevToolsPath.UrlString;
170+
const SIGN_IN_URL = 'https://accounts.google.com' as Platform.DevToolsPath.UrlString;
172171

173172
const enum State {
174173
INSIGHT = 'insight',
@@ -529,17 +528,8 @@ export class ConsoleInsight extends HTMLElement {
529528
}
530529
}
531530

532-
#onGoToChromeSettings(): void {
533-
const rootTarget = SDK.TargetManager.TargetManager.instance().rootTarget();
534-
if (rootTarget === null) {
535-
return;
536-
}
537-
const url = CHROME_SETTINGS_URL;
538-
void rootTarget.targetAgent().invoke_createTarget({url}).then(result => {
539-
if (result.getError()) {
540-
Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(url);
541-
}
542-
});
531+
#onGoToSignIn(): void {
532+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(SIGN_IN_URL);
543533
}
544534

545535
#focusHeader(): void {
@@ -740,15 +730,15 @@ export class ConsoleInsight extends HTMLElement {
740730
<div class="filler"></div>
741731
<div>
742732
<devtools-button
743-
@click=${this.#onGoToChromeSettings}
733+
@click=${this.#onGoToSignIn}
744734
.data=${
745735
{
746736
variant: Buttons.Button.Variant.PRIMARY,
747737
jslogContext: 'update-settings',
748738
} as Buttons.Button.ButtonData
749739
}
750740
>
751-
${UIStrings.updateSettings}
741+
${UIStrings.signIn}
752742
</devtools-button>
753743
</div>
754744
</footer>`;

0 commit comments

Comments
 (0)