summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/options
diff options
context:
space:
mode:
authorkaliamoorthi@chromium.org <kaliamoorthi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 17:19:27 +0000
committerkaliamoorthi@chromium.org <kaliamoorthi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 17:19:27 +0000
commit2ee9787ebe0c90514aa9bcce35331a0ba80c1adf (patch)
tree8f57f489c11ed854c0d49402db6b6b30e88c8ea2 /chrome/browser/ui/webui/options
parentfe9d60910fa71569bc1b65acdfe62fe0c159a48f (diff)
downloadchromium_src-2ee9787ebe0c90514aa9bcce35331a0ba80c1adf.zip
chromium_src-2ee9787ebe0c90514aa9bcce35331a0ba80c1adf.tar.gz
chromium_src-2ee9787ebe0c90514aa9bcce35331a0ba80c1adf.tar.bz2
Make 'Disconnect from Google account' dialog box show correct message
This CL makes 'Disconnect from Google account' dialog show the correct message in all usage scenarios. Further, the cancel button is made the default in the dialog. BUG=374715,374723 Review URL: https://codereview.chromium.org/339023003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/webui/options')
-rw-r--r--chrome/browser/ui/webui/options/manage_profile_handler.cc16
-rw-r--r--chrome/browser/ui/webui/options/manage_profile_handler.h4
-rw-r--r--chrome/browser/ui/webui/options/options_ui_browsertest.cc9
3 files changed, 23 insertions, 6 deletions
diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.cc b/chrome/browser/ui/webui/options/manage_profile_handler.cc
index 61e1e4d..a2ece94 100644
--- a/chrome/browser/ui/webui/options/manage_profile_handler.cc
+++ b/chrome/browser/ui/webui/options/manage_profile_handler.cc
@@ -185,6 +185,10 @@ void ManageProfileHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("refreshGaiaPicture",
base::Bind(&ManageProfileHandler::RefreshGaiaPicture,
base::Unretained(this)));
+ web_ui()->RegisterMessageCallback(
+ "showDisconnectManagedProfileDialog",
+ base::Bind(&ManageProfileHandler::ShowDisconnectManagedProfileDialog,
+ base::Unretained(this)));
}
void ManageProfileHandler::Uninitialize() {
@@ -313,6 +317,14 @@ void ManageProfileHandler::SendExistingProfileNames() {
"ManageProfileOverlay.receiveExistingProfileNames", profile_name_dict);
}
+void ManageProfileHandler::ShowDisconnectManagedProfileDialog(
+ const base::ListValue* args) {
+ base::DictionaryValue replacements;
+ GenerateSignedinUserSpecificStrings(&replacements);
+ web_ui()->CallJavascriptFunction(
+ "ManageProfileOverlay.showDisconnectManagedProfileDialog", replacements);
+}
+
void ManageProfileHandler::SetProfileIconAndName(const base::ListValue* args) {
DCHECK(args);
@@ -468,10 +480,6 @@ void ManageProfileHandler::RequestCreateProfileUpdate(
base::StringValue(username),
base::FundamentalValue(has_error));
- base::DictionaryValue replacements;
- GenerateSignedinUserSpecificStrings(&replacements);
- web_ui()->CallJavascriptFunction("loadTimeData.overrideValues", replacements);
-
OnCreateSupervisedUserPrefChange();
}
diff --git a/chrome/browser/ui/webui/options/manage_profile_handler.h b/chrome/browser/ui/webui/options/manage_profile_handler.h
index d004ec7..36f8cf5 100644
--- a/chrome/browser/ui/webui/options/manage_profile_handler.h
+++ b/chrome/browser/ui/webui/options/manage_profile_handler.h
@@ -72,6 +72,10 @@ class ManageProfileHandler : public OptionsPageUIHandler,
// This is used to detect duplicate profile names.
void SendExistingProfileNames();
+ // Show disconnect managed profile dialog after generating domain and user
+ // specific strings.
+ void ShowDisconnectManagedProfileDialog(const base::ListValue* args);
+
// Callback for the "setProfileIconAndName" message. Sets the name and icon
// of a given profile.
// |args| is of the form: [
diff --git a/chrome/browser/ui/webui/options/options_ui_browsertest.cc b/chrome/browser/ui/webui/options/options_ui_browsertest.cc
index 5d8a70a..7ee21db 100644
--- a/chrome/browser/ui/webui/options/options_ui_browsertest.cc
+++ b/chrome/browser/ui/webui/options/options_ui_browsertest.cc
@@ -202,8 +202,13 @@ IN_PROC_BROWSER_TEST_F(OptionsUIBrowserTest, MAYBE_VerifyManagedSignout) {
browser()->tab_strip_model()->GetActiveWebContents(),
"var dialog = $('manage-profile-overlay-disconnect-managed');"
"var original_status = dialog.hidden;"
- "$('start-stop-sync').click();"
- "domAutomationController.send(original_status && !dialog.hidden);",
+ "var original = ManageProfileOverlay.showDisconnectManagedProfileDialog;"
+ "var teststub = function(event) {"
+ " original(event);"
+ " domAutomationController.send(original_status && !dialog.hidden);"
+ "};"
+ "ManageProfileOverlay.showDisconnectManagedProfileDialog = teststub;"
+ "$('start-stop-sync').click();",
&result));
EXPECT_TRUE(result);