Commit e870d8e7 authored by haitaol@chromium.org's avatar haitaol@chromium.org

Add a checkbox on stop-sync dialog to allow user to choose whether to delete

all their data(profile), too. If checked, user will be prompted again to
confirm profile deletion.

BUG=363272
NOTRY=true

Review URL: https://codereview.chromium.org/235943011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268276 0039d316-1c4b-4281-b951-d872f2087c98
parent 41803c5b
...@@ -12206,6 +12206,9 @@ Some features may be unavailable. Please check that the profile exists and you ...@@ -12206,6 +12206,9 @@ Some features may be unavailable. Please check that the profile exists and you
<message name="IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL" desc="The text to display below the 'Stop syncing this account' button on the options pane, explaining what the button does."> <message name="IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL" desc="The text to display below the 'Stop syncing this account' button on the options pane, explaining what the button does.">
By disconnecting your Google Account from <ph name="PRODUCT_NAME">$1<ex>Chrome</ex></ph>, your data will remain on this computer but changes will no longer be synced to your Google Account. Data already stored in your Google Account will remain there until you remove it using <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>. By disconnecting your Google Account from <ph name="PRODUCT_NAME">$1<ex>Chrome</ex></ph>, your data will remain on this computer but changes will no longer be synced to your Google Account. Data already stored in your Google Account will remain there until you remove it using <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>
<message name="IDS_SYNC_STOP_DELETE_PROFILE_LABEL" desc="The text to display by the checkbox asking user whether to also delete profile when stopping sync.">
Also clear your history, bookmarks, settings, and other Chrome data stored on this device.
</message>
<message name="IDS_SYNC_ADVANCED_OPTIONS" desc="The text in the link that brings up the sync configure screen in the new tab page new data type notification."> <message name="IDS_SYNC_ADVANCED_OPTIONS" desc="The text in the link that brings up the sync configure screen in the new tab page new data type notification.">
Advanced settings Advanced settings
</message> </message>
......
...@@ -1288,6 +1288,15 @@ cr.define('options', function() { ...@@ -1288,6 +1288,15 @@ cr.define('options', function() {
'There should always be a current profile, but none found.'); 'There should always be a current profile, but none found.');
}, },
/**
* Propmpts user to confirm deletion of the profile for this browser
* window.
* @private
*/
deleteCurrentProfile_: function() {
ManageProfileOverlay.showDeleteDialog(this.getCurrentProfile_());
},
setNativeThemeButtonEnabled_: function(enabled) { setNativeThemeButtonEnabled_: function(enabled) {
var button = $('themes-native-button'); var button = $('themes-native-button');
if (button) if (button)
...@@ -1755,6 +1764,7 @@ cr.define('options', function() { ...@@ -1755,6 +1764,7 @@ cr.define('options', function() {
//Forward public APIs to private implementations. //Forward public APIs to private implementations.
[ [
'addBluetoothDevice', 'addBluetoothDevice',
'deleteCurrentProfile',
'enableCertificateButton', 'enableCertificateButton',
'enableFactoryResetSection', 'enableFactoryResetSection',
'getCurrentProfile', 'getCurrentProfile',
......
...@@ -98,6 +98,10 @@ ...@@ -98,6 +98,10 @@
min-width: 87px; min-width: 87px;
} }
#sync-setup-delete-profile {
margin: 10px 0;
}
#email-readonly { #email-readonly {
font-size: 15px; font-size: 15px;
height: 29px; height: 29px;
......
...@@ -220,6 +220,14 @@ ...@@ -220,6 +220,14 @@
<h1 i18n-content="stopSyncingTitle"></h1> <h1 i18n-content="stopSyncingTitle"></h1>
<div class="content-area"> <div class="content-area">
<span i18n-values=".innerHTML:stopSyncingExplanation"></span> <span i18n-values=".innerHTML:stopSyncingExplanation"></span>
<if expr="(not chromeos and is_posix) or is_win or is_macosx">
<div id="sync-setup-delete-profile" class="checkbox">
<label>
<input id="delete-profile" type="checkbox">
<span i18n-content="deleteProfileLabel"></span>
</label>
</div>
</if>
</div> </div>
<div class="action-area button-strip"> <div class="action-area button-strip">
<input id="stop-syncing-cancel" type="button" <input id="stop-syncing-cancel" type="button"
......
...@@ -83,7 +83,9 @@ cr.define('options', function() { ...@@ -83,7 +83,9 @@ cr.define('options', function() {
self.closeOverlay_(); self.closeOverlay_();
}; };
$('stop-syncing-ok').onclick = function() { $('stop-syncing-ok').onclick = function() {
chrome.send('SyncSetupStopSyncing'); var deleteProfile = $('delete-profile') != undefined &&
$('delete-profile').checked;
chrome.send('SyncSetupStopSyncing', [deleteProfile]);
self.closeOverlay_(); self.closeOverlay_();
}; };
}, },
......
...@@ -228,6 +228,8 @@ void SyncSetupHandler::GetStaticLocalizedValues( ...@@ -228,6 +228,8 @@ void SyncSetupHandler::GetStaticLocalizedValues(
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
base::ASCIIToUTF16(google_util::StringAppendGoogleLocaleParam( base::ASCIIToUTF16(google_util::StringAppendGoogleLocaleParam(
chrome::kSyncGoogleDashboardURL)))); chrome::kSyncGoogleDashboardURL))));
localized_strings->SetString("deleteProfileLabel",
l10n_util::GetStringUTF16(IDS_SYNC_STOP_DELETE_PROFILE_LABEL));
localized_strings->SetString("stopSyncingTitle", localized_strings->SetString("stopSyncingTitle",
l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_DIALOG_TITLE)); l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_DIALOG_TITLE));
localized_strings->SetString("stopSyncingConfirm", localized_strings->SetString("stopSyncingConfirm",
...@@ -779,6 +781,12 @@ void SyncSetupHandler::HandleStopSyncing(const base::ListValue* args) { ...@@ -779,6 +781,12 @@ void SyncSetupHandler::HandleStopSyncing(const base::ListValue* args) {
if (GetSyncService()) if (GetSyncService())
ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);
SigninManagerFactory::GetForProfile(GetProfile())->SignOut(); SigninManagerFactory::GetForProfile(GetProfile())->SignOut();
bool delete_profile = false;
if (args->GetBoolean(0, &delete_profile) && delete_profile) {
web_ui()->CallJavascriptFunction(
"BrowserOptions.deleteCurrentProfile");
}
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment