Skip to content

Commit

Permalink
[Lacros] Change strings on turn off sync page
Browse files Browse the repository at this point in the history
The main profile does not get logged out when turning off sync.
Change strings to reflect that.

Fixed: 1314289
Change-Id: Id560887cc4cb2b7a51be8feefc92d7630a133f0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3572637
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Fabian Sommer <fabiansommer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#990312}
  • Loading branch information
Fabian-Sommer authored and Chromium LUCI CQ committed Apr 8, 2022
1 parent 3fe31cf commit d706b67
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 3 deletions.
6 changes: 6 additions & 0 deletions chrome/app/settings_strings.grdp
Expand Up @@ -3460,6 +3460,9 @@
<message name="IDS_SETTINGS_SYNC_DISCONNECT_MANAGED_PROFILE_EXPLANATION" desc="The text to display in the 'Sign out of Chrome' dialog to stop syncing for managed profiles.">
Because this account is managed by <ph name="DOMAIN">$1<ex>example.com</ex></ph>, your bookmarks, history, passwords, and other settings will be cleared from this device. However, your data will remain stored in your Google Account and can be managed on <ph name="BEGIN_LINK">&lt;a href="$2" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$2" target=&quot;_blank&quot;&gt;</ex></ph>Google Dashboard<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>.
</message>
<message name="IDS_SETTINGS_TURN_OFF_SYNC_DIALOG_TITLE" desc="The text to display on the title of the dialog to turn off sync.">
Turn off sync?
</message>
<message name="IDS_SETTINGS_TURN_OFF_SYNC_AND_SIGN_OUT_DIALOG_TITLE" desc="The text to display on the title of the dialog to turn off sync and sign out.">
Turn off sync and personalization?
</message>
Expand Down Expand Up @@ -3500,6 +3503,9 @@
<message name="IDS_SETTINGS_SYNC_DISCONNECT_EXPLANATION" desc="The text to display in the Sign out of Chrome dialog to stop syncing for non-managed profiles.">
Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Google Account. However, your existing data will remain stored in your Google Account and can be managed on <ph name="BEGIN_LINK">&lt;a href="$1" target=&quot;_blank&quot;&gt;<ex>&lt;a href="$1" target=&quot;_blank&quot;&gt;</ex></ph>Google Dashboard<ph name="END_LINK">&lt;/a&gt;<ex>&lt;/a&gt;</ex></ph>.
</message>
<message name="IDS_SETTINGS_SYNC_DISCONNECT_MAIN_PROFILE_EXPLANATION" desc="The text to display in the Turn off sync dialog to stop syncing for the main profile in Lacros.">
Your bookmarks, history, passwords, and more will no longer be synced.
</message>
<message name="IDS_SETTINGS_SYNC_DISCONNECT_AND_SIGN_OUT_EXPLANATION" desc="The text to display in the Sign out of Chrome dialog to stop syncing and sign-out for non-managed profiles.">
This will sign you out of your Google Accounts. Your bookmarks, history, passwords, and more will no longer be synced.
</message>
Expand Down
@@ -0,0 +1 @@
46cb516b35d64ebf8c89e7b23895e89b1f06e376
@@ -0,0 +1 @@
46cb516b35d64ebf8c89e7b23895e89b1f06e376
Expand Up @@ -41,7 +41,7 @@
</cr-button>
</div>
<if expr="(not chromeos_ash and is_posix) or is_win or is_macosx">
<template is="dom-if" if="[[!syncStatus.domain]]">
<template is="dom-if" if="[[isFooterVisible_]]">
<div id="wideFooter" slot="footer">
<div class="cr-row first">
<cr-checkbox id="deleteProfile" class="flex"
Expand Down
18 changes: 18 additions & 0 deletions chrome/browser/resources/settings/people_page/signout_dialog.ts
Expand Up @@ -71,13 +71,22 @@ export class SettingsSignoutDialogElement extends
* stats is returned from the browser.
*/
deleteProfileWarning_: String,

/**
* True if the footer for the profile deletion is visible.
*/
isFooterVisible_: {
type: Boolean,
computed: 'computeIsFooterVisible_()',
},
};
}

syncStatus: SyncStatus|null;
private deleteProfile_: boolean;
private deleteProfileWarningVisible_: boolean;
private deleteProfileWarning_: string;
private isFooterVisible_: boolean;

override connectedCallback() {
super.connectedCallback();
Expand Down Expand Up @@ -157,6 +166,15 @@ export class SettingsSignoutDialogElement extends
SyncBrowserProxyImpl.getInstance().turnOffSync();
// </if>
}

private computeIsFooterVisible_(): boolean {
// <if expr="chromeos_lacros">
if (!loadTimeData.getBoolean('isSecondaryUser')) {
return false;
}
// </if>
return !this.syncStatus!.domain;
}
}

declare global {
Expand Down
Expand Up @@ -1268,7 +1268,19 @@ void AddSignOutDialogStrings(content::WebUIDataSource* html_source,
AccountConsistencyModeManager::IsDiceEnabledForProfile(profile);
#endif

if (is_dice_enabled) {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
bool is_main_profile = profile->IsMainProfile();
#else
bool is_main_profile = false;
#endif

if (is_main_profile) {
static constexpr webui::LocalizedString kTurnOffStrings[] = {
{"syncDisconnect", IDS_SETTINGS_PEOPLE_SYNC_TURN_OFF},
{"syncDisconnectTitle", IDS_SETTINGS_TURN_OFF_SYNC_DIALOG_TITLE},
};
html_source->AddLocalizedStrings(kTurnOffStrings);
} else if (is_dice_enabled) {
static constexpr webui::LocalizedString kTurnOffStrings[] = {
{"syncDisconnect", IDS_SETTINGS_PEOPLE_SYNC_TURN_OFF},
{"syncDisconnectTitle",
Expand All @@ -1289,7 +1301,17 @@ void AddSignOutDialogStrings(content::WebUIDataSource* html_source,
g_browser_process->GetApplicationLocale())
.spec();

if (is_dice_enabled) {
if (is_main_profile) {
static constexpr webui::LocalizedString kSyncDisconnectStrings[] = {
{"syncDisconnectDeleteProfile",
IDS_SETTINGS_TURN_OFF_SYNC_DIALOG_CHECKBOX},
{"syncDisconnectConfirm",
IDS_SETTINGS_TURN_OFF_SYNC_DIALOG_MANAGED_CONFIRM},
{"syncDisconnectExplanation",
IDS_SETTINGS_SYNC_DISCONNECT_MAIN_PROFILE_EXPLANATION},
};
html_source->AddLocalizedStrings(kSyncDisconnectStrings);
} else if (is_dice_enabled) {
static constexpr webui::LocalizedString kSyncDisconnectStrings[] = {
{"syncDisconnectDeleteProfile",
IDS_SETTINGS_TURN_OFF_SYNC_DIALOG_CHECKBOX},
Expand Down

0 comments on commit d706b67

Please sign in to comment.