diff options
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); |