Index: chrome/browser/ui/sync/one_click_signin_sync_starter.h |
=================================================================== |
--- chrome/browser/ui/sync/one_click_signin_sync_starter.h (revision 199941) |
+++ chrome/browser/ui/sync/one_click_signin_sync_starter.h (working copy) |
@@ -38,6 +38,19 @@ |
UNDO_SYNC |
}; |
+ enum ConfirmationRequired { |
+ // No need to display a "post-signin" confirmation bubble (for example, if |
+ // the user was doing a re-auth flow). |
+ NO_CONFIRMATION, |
+ |
+ // Signin flow redirected outside of trusted domains, so ask the user to |
+ // confirm before signing in. |
+ CONFIRM_UNTRUSTED_SIGNIN, |
+ |
+ // Display a confirmation after signing in. |
+ CONFIRM_AFTER_SIGNIN |
+ }; |
+ |
// |profile| must not be NULL, however |browser| can be. When using the |
// OneClickSigninSyncStarter from a browser, provide both. |
// If |display_confirmation| is true, the user will be prompted to confirm the |
@@ -49,7 +62,7 @@ |
const std::string& password, |
StartSyncMode start_mode, |
bool force_same_tab_navigation, |
- bool display_confirmation); |
+ ConfirmationRequired display_confirmation); |
private: |
virtual ~OneClickSigninSyncStarter(); |
@@ -94,28 +107,37 @@ |
// confirmation is required (in which case we have to prompt the user first). |
void ConfirmSignin(const std::string& oauth_token); |
- // Displays confirmation UI to the user if confirmation_required_ is true, |
- // otherwise completes the pending signin process. |
- void SigninAfterSAMLConfirmation(); |
+ // Displays confirmation UI to the user if confirmation_required_ == |
+ // CONFIRM_UNTRUSTED_SIGNIN, otherwise completes the pending signin process. |
+ void ConfirmAndSignin(); |
// Callback invoked once the user has responded to the signin confirmation UI. |
// If response == UNDO_SYNC, the signin is cancelled, otherwise the pending |
// signin is completed. |
- void SigninConfirmationComplete(StartSyncMode response); |
+ void UntrustedSigninConfirmed(StartSyncMode response); |
ProfileSyncService* GetProfileSyncService(); |
- // Displays the sync configuration UI, then frees this object. |
+ // Displays the sync configuration UI. |
void ConfigureSync(); |
void ShowSyncSettingsPageOnSameTab(); |
+ // Shows the post-signin confirmation bubble. If |custom_message| is empty, |
+ // the default "You are signed in" message is displayed. |
+ void DisplayFinalConfirmationBubble(const string16& custom_message); |
+ |
+ // Makes sure browser_ points to a valid browser (opens a new browser if |
+ // necessary). Useful in the case where the user has created a new Profile as |
+ // part of the signin process. |
+ void EnsureBrowser(); |
+ |
Profile* profile_; |
Browser* browser_; |
scoped_ptr<SigninTracker> signin_tracker_; |
StartSyncMode start_mode_; |
chrome::HostDesktopType desktop_type_; |
bool force_same_tab_navigation_; |
- bool confirmation_required_; |
+ ConfirmationRequired confirmation_required_; |
base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; |
#if defined(ENABLE_CONFIGURATION_POLICY) |