| 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_WEBUI_SYNC_SETUP_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/timer.h" | 10 #include "base/timer.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 void HandleShowErrorUI(const base::ListValue* args); | 126 void HandleShowErrorUI(const base::ListValue* args); |
| 127 void HandleShowSetupUI(const base::ListValue* args); | 127 void HandleShowSetupUI(const base::ListValue* args); |
| 128 void HandleShowSetupUIWithoutLogin(const base::ListValue* args); | 128 void HandleShowSetupUIWithoutLogin(const base::ListValue* args); |
| 129 void HandleDoSignOutOnAuthError(const base::ListValue* args); | 129 void HandleDoSignOutOnAuthError(const base::ListValue* args); |
| 130 void HandleStartSignin(const base::ListValue* args); | 130 void HandleStartSignin(const base::ListValue* args); |
| 131 void HandleStopSyncing(const base::ListValue* args); | 131 void HandleStopSyncing(const base::ListValue* args); |
| 132 void HandleCloseTimeout(const base::ListValue* args); | 132 void HandleCloseTimeout(const base::ListValue* args); |
| 133 #if !defined(OS_CHROMEOS) | 133 #if !defined(OS_CHROMEOS) |
| 134 void HandleSubmitAuth(const base::ListValue* args); | 134 void HandleSubmitAuth(const base::ListValue* args); |
| 135 | 135 |
| 136 // Returns true if the given login data is valid, false otherwise. If the |
| 137 // login data is not valid then on return |error_message| will be set to a |
| 138 // localized error message. Note, |error_message| must not be NULL. |
| 139 bool IsLoginAuthDataValid(const std::string& username, |
| 140 string16* error_message); |
| 141 |
| 136 // Initiates a login via the signin manager. | 142 // Initiates a login via the signin manager. |
| 137 void TryLogin(const std::string& username, | 143 void TryLogin(const std::string& username, |
| 138 const std::string& password, | 144 const std::string& password, |
| 139 const std::string& captcha, | 145 const std::string& captcha, |
| 140 const std::string& access_code); | 146 const std::string& access_code); |
| 141 #endif | 147 #endif |
| 142 | 148 |
| 143 // Helper routine that gets the Profile associated with this object (virtual | 149 // Helper routine that gets the Profile associated with this object (virtual |
| 144 // so tests can override). | 150 // so tests can override). |
| 145 virtual Profile* GetProfile() const; | 151 virtual Profile* GetProfile() const; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // If a wizard already exists, focus it and return true. | 190 // If a wizard already exists, focus it and return true. |
| 185 bool FocusExistingWizardIfPresent(); | 191 bool FocusExistingWizardIfPresent(); |
| 186 | 192 |
| 187 // Invokes the javascript call to close the setup overlay. | 193 // Invokes the javascript call to close the setup overlay. |
| 188 void CloseOverlay(); | 194 void CloseOverlay(); |
| 189 | 195 |
| 190 // When using web-flow, closes the Gaia page used to collection user | 196 // When using web-flow, closes the Gaia page used to collection user |
| 191 // credentials. | 197 // credentials. |
| 192 void CloseGaiaSigninPage(); | 198 void CloseGaiaSigninPage(); |
| 193 | 199 |
| 194 // Returns true if the given login data is valid, false otherwise. If the | |
| 195 // login data is not valid then on return |error_message| will be set to a | |
| 196 // localized error message. Note, |error_message| must not be NULL. | |
| 197 bool IsLoginAuthDataValid(const std::string& username, | |
| 198 string16* error_message); | |
| 199 | |
| 200 // The SigninTracker object used to determine when the user has fully signed | 200 // The SigninTracker object used to determine when the user has fully signed |
| 201 // in (this requires waiting for various services to initialize and tracking | 201 // in (this requires waiting for various services to initialize and tracking |
| 202 // errors from multiple sources). Should only be non-null while the login UI | 202 // errors from multiple sources). Should only be non-null while the login UI |
| 203 // is visible. | 203 // is visible. |
| 204 scoped_ptr<SigninTracker> signin_tracker_; | 204 scoped_ptr<SigninTracker> signin_tracker_; |
| 205 | 205 |
| 206 // Set to true whenever the sync configure UI is visible. This is used to tell | 206 // Set to true whenever the sync configure UI is visible. This is used to tell |
| 207 // what stage of the setup wizard the user was in and to update the UMA | 207 // what stage of the setup wizard the user was in and to update the UMA |
| 208 // histograms in the case that the user cancels out. | 208 // histograms in the case that the user cancels out. |
| 209 bool configuring_sync_; | 209 bool configuring_sync_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 226 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; | 226 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; |
| 227 | 227 |
| 228 // When using web-flow, weak pointer to the tab that holds the Gaia sign in | 228 // When using web-flow, weak pointer to the tab that holds the Gaia sign in |
| 229 // page. | 229 // page. |
| 230 content::WebContents* active_gaia_signin_tab_; | 230 content::WebContents* active_gaia_signin_tab_; |
| 231 | 231 |
| 232 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 232 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 235 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
| OLD | NEW |