Commit 37bd798e authored by mahmadi's avatar mahmadi Committed by Commit bot

Makes 'Disconnect Account' overlay in chrome://settings accessible thru a URL

BUG=615893
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2136103008
Cr-Commit-Position: refs/heads/master@{#405570}
parent 6af0996a
......@@ -11635,7 +11635,7 @@ Some features may be unavailable. Please check that the profile exists and you
Disconnect your Google Account...
</message>
<message name="IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL" desc="The text to display on the button to confirm the user wishes to stop syncing.">
Disconnect account
Sign Out
</message>
<message name="IDS_SYNC_STOP_SYNCING_DIALOG_TITLE" desc="The title of the dialog that explains what 'stop syncing' means.">
Disconnect your Google Account
......@@ -12914,6 +12914,9 @@ Some features may be unavailable. Please check that the profile exists and you
<!-- Android does not support multiple profiles and supervised users -->
<if expr="not is_android">
<!-- Manage Profile Dialog -->
<message name="IDS_DISCONNECT_ACCOUNT_TITLE" desc="Title of the disconnect account dialog">
Disconnect Account
</message>
<message name="IDS_PROFILES_MANAGE_TITLE" desc="Title of the manage profile dialog">
Edit
</message>
......
......@@ -17,7 +17,7 @@ cr.define('options', function() {
Page.call(this, 'manageProfile',
loadTimeData.getString('manageProfileTabTitle'),
'manage-profile-overlay');
};
}
cr.addSingletonGetter(ManageProfileOverlay);
......@@ -595,9 +595,7 @@ cr.define('options', function() {
loadTimeData.getString('disconnectManagedProfileText');
$('manage-profile-overlay-disconnect-managed').hidden = false;
// Because this dialog isn't useful when refreshing or as part of the
// history, don't create a history entry for it when showing.
PageManager.showPageByName('manageProfile', false);
PageManager.showPageByName('signOut');
},
/**
......@@ -623,16 +621,46 @@ cr.define('options', function() {
'showCreateDialog',
]);
/**
* @constructor
* @extends {options.ManageProfileOverlay}
*/
function DisconnectAccountOverlay() {
Page.call(this, 'signOut',
loadTimeData.getString('disconnectAccountTabTitle'),
'manage-profile-overlay');
}
cr.addSingletonGetter(DisconnectAccountOverlay);
DisconnectAccountOverlay.prototype = {
__proto__: ManageProfileOverlay.prototype,
/** @override */
canShowPage: function() {
var syncData = loadTimeData.getValue('syncData');
return syncData.signedIn && !syncData.signoutAllowed;
},
/** @override */
didShowPage: function() {
chrome.send('showDisconnectManagedProfileDialog');
}
};
/**
* @constructor
* @extends {options.ManageProfileOverlay}
*/
function CreateProfileOverlay() {
Page.call(this, 'createProfile',
loadTimeData.getString('createProfileTabTitle'),
'manage-profile-overlay');
};
}
cr.addSingletonGetter(CreateProfileOverlay);
CreateProfileOverlay.prototype = {
// Inherit from ManageProfileOverlay.
__proto__: ManageProfileOverlay.prototype,
// The signed-in email address of the current profile, or empty if they're
......@@ -883,6 +911,7 @@ cr.define('options', function() {
// Export
return {
ManageProfileOverlay: ManageProfileOverlay,
DisconnectAccountOverlay: DisconnectAccountOverlay,
CreateProfileOverlay: CreateProfileOverlay,
};
});
......@@ -30,6 +30,7 @@ var HotwordConfirmDialog = options.HotwordConfirmDialog;
var ImportDataOverlay = options.ImportDataOverlay;
var LanguageOptions = options.LanguageOptions;
var ManageProfileOverlay = options.ManageProfileOverlay;
var DisconnectAccountOverlay = options.DisconnectAccountOverlay;
var OptionsFocusManager = options.OptionsFocusManager;
var OptionsPage = options.OptionsPage;
var PageManager = cr.ui.pageManager.PageManager;
......@@ -123,6 +124,8 @@ function load() {
$('show-cookies-button')]);
PageManager.registerOverlay(CreateProfileOverlay.getInstance(),
BrowserOptions.getInstance());
PageManager.registerOverlay(DisconnectAccountOverlay.getInstance(),
BrowserOptions.getInstance());
PageManager.registerOverlay(EasyUnlockTurnOffOverlay.getInstance(),
BrowserOptions.getInstance(),
[$('easy-unlock-turn-off-button')]);
......
......@@ -123,6 +123,8 @@ void ManageProfileHandler::GetLocalizedValues(
RegisterStrings(localized_strings, resources, arraysize(resources));
RegisterTitle(localized_strings, "manageProfile", IDS_PROFILES_MANAGE_TITLE);
RegisterTitle(localized_strings, "createProfile", IDS_PROFILES_CREATE_TITLE);
RegisterTitle(localized_strings, "disconnectAccount",
IDS_DISCONNECT_ACCOUNT_TITLE);
base::string16 supervised_user_dashboard_url =
base::ASCIIToUTF16(chrome::kLegacySupervisedUserManagementURL);
......
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