summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-26 23:27:30 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-26 23:27:30 +0000
commit7b40ab59c23f23c138cf23330eb586c1925f2234 (patch)
tree13835e6f09fdd650f2e003d2e1240dbe71576401 /chrome/browser/ui
parent3586962cf6d542d53a342fb4823b36b09ba71544 (diff)
downloadchromium_src-7b40ab59c23f23c138cf23330eb586c1925f2234.zip
chromium_src-7b40ab59c23f23c138cf23330eb586c1925f2234.tar.gz
chromium_src-7b40ab59c23f23c138cf23330eb586c1925f2234.tar.bz2
To reduce cross-account sync confusion, give the user a warning at sync sign in time if the account they are signing into is different from the account that the profile was previously signed into
TBR=jhawkins@chromium.org BUG=157761 TEST=Create a new profile and connect it to an account. Make sure it connects with no warnings. Disconnect the account and try to connect a different account. Should get a warning as specified in bug description. Pressing "sign in" again without changing anything should allow the sign in to processed as expected. original codereview by rogerta@: http://codereview.chromium.org/11272023/ Review URL: https://codereview.chromium.org/11311016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/webui/sync_setup_handler.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc
index 6215cd8..556d803 100644
--- a/chrome/browser/ui/webui/sync_setup_handler.cc
+++ b/chrome/browser/ui/webui/sync_setup_handler.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/sync/profile_sync_service.h"
@@ -29,6 +30,7 @@
#include "chrome/browser/ui/webui/signin/login_ui_service_factory.h"
#include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -287,6 +289,7 @@ void SyncSetupHandler::GetStaticLocalizedValues(
{ "emailLabel", IDS_SYNC_LOGIN_EMAIL_NEW_LINE },
{ "passwordLabel", IDS_SYNC_LOGIN_PASSWORD_NEW_LINE },
{ "invalidCredentials", IDS_SYNC_INVALID_USER_CREDENTIALS },
+ { "differentEmail", IDS_SYNC_DIFFERENT_EMAIL },
{ "signin", IDS_SYNC_SIGNIN },
{ "couldNotConnect", IDS_SYNC_LOGIN_COULD_NOT_CONNECT },
{ "unrecoverableError", IDS_SYNC_UNRECOVERABLE_ERROR },
@@ -603,6 +606,12 @@ void SyncSetupHandler::DisplayGaiaLoginWithErrorMessage(
else if (error == GoogleServiceAuthError::CAPTCHA_REQUIRED)
args.SetBoolean("hideEmailAndPassword", false);
+ // Tell the page the previous email address used for sync. If the user
+ // enters a different email address, he will be shown a warning.
+ std::string last_email = GetProfile()->GetPrefs()->GetString(
+ prefs::kGoogleServicesLastUsername);
+ args.SetString("lastEmailAddress", last_email);
+
args.SetBoolean("editableUser", editable_user);
if (!local_error_message.empty())
args.SetString("errorMessage", local_error_message);