| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ | 5 #ifndef CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
| 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ | 6 #define CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 // SigninTracker::Observer override. | 128 // SigninTracker::Observer override. |
| 129 void SigninFailed(const GoogleServiceAuthError& error) override; | 129 void SigninFailed(const GoogleServiceAuthError& error) override; |
| 130 void SigninSuccess() override; | 130 void SigninSuccess() override; |
| 131 void AccountAddedToCookie(const GoogleServiceAuthError& error) override; | 131 void AccountAddedToCookie(const GoogleServiceAuthError& error) override; |
| 132 | 132 |
| 133 // LoginUIService::Observer override. | 133 // LoginUIService::Observer override. |
| 134 void OnSyncConfirmationUIClosed( | 134 void OnSyncConfirmationUIClosed( |
| 135 LoginUIService::SyncConfirmationUIClosedResults results) override; | 135 LoginUIService::SyncConfirmationUIClosedResults results) override; |
| 136 | 136 |
| 137 #if defined(ENABLE_CONFIGURATION_POLICY) | |
| 138 // User input handler for the signin confirmation dialog. | 137 // User input handler for the signin confirmation dialog. |
| 139 class SigninDialogDelegate | 138 class SigninDialogDelegate |
| 140 : public ui::ProfileSigninConfirmationDelegate { | 139 : public ui::ProfileSigninConfirmationDelegate { |
| 141 public: | 140 public: |
| 142 SigninDialogDelegate( | 141 SigninDialogDelegate( |
| 143 base::WeakPtr<OneClickSigninSyncStarter> sync_starter); | 142 base::WeakPtr<OneClickSigninSyncStarter> sync_starter); |
| 144 virtual ~SigninDialogDelegate(); | 143 virtual ~SigninDialogDelegate(); |
| 145 void OnCancelSignin() override; | 144 void OnCancelSignin() override; |
| 146 void OnContinueSignin() override; | 145 void OnContinueSignin() override; |
| 147 void OnSigninWithNewProfile() override; | 146 void OnSigninWithNewProfile() override; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 166 | 165 |
| 167 // Helper function that loads policy with the cached |dm_token_| and | 166 // Helper function that loads policy with the cached |dm_token_| and |
| 168 // |client_id|, then completes the signin process. | 167 // |client_id|, then completes the signin process. |
| 169 void LoadPolicyWithCachedCredentials(); | 168 void LoadPolicyWithCachedCredentials(); |
| 170 | 169 |
| 171 // Callback invoked once a profile is created, so we can complete the | 170 // Callback invoked once a profile is created, so we can complete the |
| 172 // credentials transfer, load policy, and open the first window. | 171 // credentials transfer, load policy, and open the first window. |
| 173 void CompleteInitForNewProfile(Profile* profile, | 172 void CompleteInitForNewProfile(Profile* profile, |
| 174 Profile::CreateStatus status); | 173 Profile::CreateStatus status); |
| 175 | 174 |
| 176 #endif // defined(ENABLE_CONFIGURATION_POLICY) | |
| 177 | |
| 178 // Cancels the in-progress signin for this profile. | 175 // Cancels the in-progress signin for this profile. |
| 179 void CancelSigninAndDelete(); | 176 void CancelSigninAndDelete(); |
| 180 | 177 |
| 181 // Callback invoked to check whether the user needs policy or if a | 178 // Callback invoked to check whether the user needs policy or if a |
| 182 // confirmation is required (in which case we have to prompt the user first). | 179 // confirmation is required (in which case we have to prompt the user first). |
| 183 void ConfirmSignin(const std::string& oauth_token); | 180 void ConfirmSignin(const std::string& oauth_token); |
| 184 | 181 |
| 185 // Displays confirmation UI to the user if confirmation_required_ == | 182 // Displays confirmation UI to the user if confirmation_required_ == |
| 186 // CONFIRM_UNTRUSTED_SIGNIN, otherwise completes the pending signin process. | 183 // CONFIRM_UNTRUSTED_SIGNIN, otherwise completes the pending signin process. |
| 187 void ConfirmAndSignin(); | 184 void ConfirmAndSignin(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 Browser* browser_; | 221 Browser* browser_; |
| 225 scoped_ptr<SigninTracker> signin_tracker_; | 222 scoped_ptr<SigninTracker> signin_tracker_; |
| 226 StartSyncMode start_mode_; | 223 StartSyncMode start_mode_; |
| 227 ConfirmationRequired confirmation_required_; | 224 ConfirmationRequired confirmation_required_; |
| 228 GURL current_url_; | 225 GURL current_url_; |
| 229 GURL continue_url_; | 226 GURL continue_url_; |
| 230 | 227 |
| 231 // Callback executed when sync setup succeeds or fails. | 228 // Callback executed when sync setup succeeds or fails. |
| 232 Callback sync_setup_completed_callback_; | 229 Callback sync_setup_completed_callback_; |
| 233 | 230 |
| 234 #if defined(ENABLE_CONFIGURATION_POLICY) | |
| 235 // Policy credentials we keep while determining whether to create | 231 // Policy credentials we keep while determining whether to create |
| 236 // a new profile for an enterprise user or not. | 232 // a new profile for an enterprise user or not. |
| 237 std::string dm_token_; | 233 std::string dm_token_; |
| 238 std::string client_id_; | 234 std::string client_id_; |
| 239 #endif | |
| 240 | 235 |
| 241 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; | 236 base::WeakPtrFactory<OneClickSigninSyncStarter> weak_pointer_factory_; |
| 242 | 237 |
| 243 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); | 238 DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncStarter); |
| 244 }; | 239 }; |
| 245 | 240 |
| 246 | 241 |
| 247 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ | 242 #endif // CHROME_BROWSER_UI_SYNC_ONE_CLICK_SIGNIN_SYNC_STARTER_H_ |
| OLD | NEW |