diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-19 21:48:01 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-19 21:48:01 +0000 |
commit | 1c738470c6dd8f53889f877bfe8ca394fe0f202e (patch) | |
tree | aeacfd0506b22f21d3cb3149cacfa963c73c0fd3 /chrome/browser/sync | |
parent | e7d5089c8c879e6af4ba82bde7919335b02e09d0 (diff) | |
download | chromium_src-1c738470c6dd8f53889f877bfe8ca394fe0f202e.zip chromium_src-1c738470c6dd8f53889f877bfe8ca394fe0f202e.tar.gz chromium_src-1c738470c6dd8f53889f877bfe8ca394fe0f202e.tar.bz2 |
Change all the places where the multi-purpose sync error link is surfaced to call a common routine that either shows a login prompt or shows the passphrase prompt depending on the reason for the error.
BUG=68962
TEST=none
Review URL: http://codereview.chromium.org/6293010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r-- | chrome/browser/sync/profile_sync_service.cc | 19 | ||||
-rw-r--r-- | chrome/browser/sync/profile_sync_service.h | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 0fdd265..2913309 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -726,6 +726,25 @@ void ProfileSyncService::ShowLoginDialog(gfx::NativeWindow parent_window) { FOR_EACH_OBSERVER(Observer, observers_, OnStateChanged()); } +void ProfileSyncService::ShowErrorUI(gfx::NativeWindow parent_window) { + if (observed_passphrase_required()) { + if (IsUsingSecondaryPassphrase()) + PromptForExistingPassphrase(parent_window); + else + ShowLoginDialog(parent_window); + return; + } + const GoogleServiceAuthError& error = GetAuthError(); + if (error.state() == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS || + error.state() == GoogleServiceAuthError::CAPTCHA_REQUIRED || + error.state() == GoogleServiceAuthError::ACCOUNT_DELETED || + error.state() == GoogleServiceAuthError::ACCOUNT_DISABLED || + error.state() == GoogleServiceAuthError::SERVICE_UNAVAILABLE) { + ShowLoginDialog(parent_window); + } +} + + void ProfileSyncService::ShowConfigure(gfx::NativeWindow parent_window) { if (WizardIsVisible()) { wizard_.Focus(); diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 9b2e98d..1d79c76 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -225,6 +225,11 @@ class ProfileSyncService : public browser_sync::SyncFrontend, return wizard_.IsVisible(); } virtual void ShowLoginDialog(gfx::NativeWindow parent_window); + + // This method handles clicks on "sync error" UI, showing the appropriate + // dialog for the error condition (relogin / enter passphrase). + virtual void ShowErrorUI(gfx::NativeWindow parent_window); + void ShowConfigure(gfx::NativeWindow parent_window); void PromptForExistingPassphrase(gfx::NativeWindow parent_window); void SigninForPassphrase(TabContents* container); |