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 "chrome/browser/signin/signin_tracker.h" | 11 #include "chrome/browser/signin/signin_tracker.h" |
11 #include "chrome/browser/ui/webui/options2/options_ui2.h" | 12 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
12 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 13 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
13 | 14 |
14 class LoginUIService; | 15 class LoginUIService; |
15 class ProfileManager; | 16 class ProfileManager; |
16 class ProfileSyncService; | 17 class ProfileSyncService; |
17 class SigninManager; | 18 class SigninManager; |
18 | 19 |
19 class SyncSetupHandler : public options2::OptionsPageUIHandler, | 20 class SyncSetupHandler : public options2::OptionsPageUIHandler, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 // A utility function to call before actually showing setup dialog. Makes sure | 135 // A utility function to call before actually showing setup dialog. Makes sure |
135 // that a new dialog can be shown and sets flag that setup is in progress. | 136 // that a new dialog can be shown and sets flag that setup is in progress. |
136 bool PrepareSyncSetup(); | 137 bool PrepareSyncSetup(); |
137 | 138 |
138 // Displays spinner-only UI indicating that something is going on in the | 139 // Displays spinner-only UI indicating that something is going on in the |
139 // background. | 140 // background. |
140 // TODO(kochi): better to show some message that the user can understand what | 141 // TODO(kochi): better to show some message that the user can understand what |
141 // is running in the background. | 142 // is running in the background. |
142 void DisplaySpinner(); | 143 void DisplaySpinner(); |
143 | 144 |
144 // Returns true if this is the active login object. | 145 // Displays an error dialog which shows timeout of starting the sync backend. |
146 void DisplayTimeout(); | |
147 | |
148 // Returns true if we're the active login object. | |
Andrew T Wilson (Slow)
2012/06/26 18:11:25
Apparently the style guide discourages pronouns. Y
James Hawkins
2012/06/26 23:00:14
Yay! Rationale: pronouns are ambiguous.
peria
2012/06/29 07:11:17
Done.
| |
145 bool IsActiveLogin() const; | 149 bool IsActiveLogin() const; |
146 | 150 |
147 // Initiates a login via the signin manager. | 151 // Initiates a login via the signin manager. |
148 void TryLogin(const std::string& username, | 152 void TryLogin(const std::string& username, |
149 const std::string& password, | 153 const std::string& password, |
150 const std::string& captcha, | 154 const std::string& captcha, |
151 const std::string& access_code); | 155 const std::string& access_code); |
152 | 156 |
153 // If a wizard already exists, focus it and return true. | 157 // If a wizard already exists, focus it and return true. |
154 bool FocusExistingWizardIfPresent(); | 158 bool FocusExistingWizardIfPresent(); |
(...skipping 30 matching lines...) Expand all Loading... | |
185 // Cache of the last name the client attempted to authenticate. | 189 // Cache of the last name the client attempted to authenticate. |
186 std::string last_attempted_user_email_; | 190 std::string last_attempted_user_email_; |
187 | 191 |
188 // The error from the last signin attempt. | 192 // The error from the last signin attempt. |
189 GoogleServiceAuthError last_signin_error_; | 193 GoogleServiceAuthError last_signin_error_; |
190 | 194 |
191 // When setup starts with login UI, retry login if signing in failed. | 195 // When setup starts with login UI, retry login if signing in failed. |
192 // When setup starts without login UI, do not retry login and fail. | 196 // When setup starts without login UI, do not retry login and fail. |
193 bool retry_on_signin_failure_; | 197 bool retry_on_signin_failure_; |
194 | 198 |
199 // The OneShotTimer object used to timeout of starting the sync backend | |
200 // service. | |
201 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; | |
202 | |
195 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 203 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
196 }; | 204 }; |
197 | 205 |
198 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 206 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
OLD | NEW |