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 "chrome/browser/signin/signin_tracker.h" | 10 #include "chrome/browser/signin/signin_tracker.h" |
11 #include "chrome/browser/ui/webui/options2/options_ui2.h" | 11 #include "chrome/browser/ui/webui/options2/options_ui2.h" |
| 12 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
12 | 13 |
13 class LoginUIService; | 14 class LoginUIService; |
14 class ProfileManager; | 15 class ProfileManager; |
15 class ProfileSyncService; | 16 class ProfileSyncService; |
16 class SigninManager; | 17 class SigninManager; |
17 | 18 |
18 class SyncSetupHandler : public options2::OptionsPageUIHandler, | 19 class SyncSetupHandler : public options2::OptionsPageUIHandler, |
19 public SigninTracker::Observer { | 20 public SigninTracker::Observer, |
| 21 public LoginUIService::LoginUI { |
20 public: | 22 public: |
21 // Constructs a new SyncSetupHandler. |profile_manager| may be NULL. | 23 // Constructs a new SyncSetupHandler. |profile_manager| may be NULL. |
22 explicit SyncSetupHandler(ProfileManager* profile_manager); | 24 explicit SyncSetupHandler(ProfileManager* profile_manager); |
23 virtual ~SyncSetupHandler(); | 25 virtual ~SyncSetupHandler(); |
24 | 26 |
25 // OptionsPageUIHandler implementation. | 27 // OptionsPageUIHandler implementation. |
26 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings) | 28 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings) |
27 OVERRIDE; | 29 OVERRIDE; |
28 virtual void RegisterMessages() OVERRIDE; | 30 virtual void RegisterMessages() OVERRIDE; |
29 | 31 |
30 // SigninTracker::Observer implementation | 32 // SigninTracker::Observer implementation. |
31 virtual void GaiaCredentialsValid() OVERRIDE; | 33 virtual void GaiaCredentialsValid() OVERRIDE; |
32 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; | 34 virtual void SigninFailed(const GoogleServiceAuthError& error) OVERRIDE; |
33 virtual void SigninSuccess() OVERRIDE; | 35 virtual void SigninSuccess() OVERRIDE; |
34 | 36 |
| 37 // LoginUIService::LoginUI implementation. |
| 38 virtual void FocusUI() OVERRIDE; |
| 39 virtual void CloseUI() OVERRIDE; |
| 40 |
35 static void GetStaticLocalizedValues( | 41 static void GetStaticLocalizedValues( |
36 base::DictionaryValue* localized_strings, | 42 base::DictionaryValue* localized_strings, |
37 content::WebUI* web_ui); | 43 content::WebUI* web_ui); |
38 | 44 |
39 // Initializes the sync setup flow and shows the setup UI. If |force_login| is | 45 // Initializes the sync setup flow and shows the setup UI. If |force_login| is |
40 // true, then the user is forced through the login flow even if they are | 46 // true, then the user is forced through the login flow even if they are |
41 // already signed in (useful for when we need to force the user to re-enter | 47 // already signed in (useful for when we need to force the user to re-enter |
42 // credentials so we can fetch new tokens). | 48 // credentials so we can fetch new tokens). |
43 void OpenSyncSetup(bool force_login); | 49 void OpenSyncSetup(bool force_login); |
44 | 50 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 // Cache of the last name the client attempted to authenticate. | 182 // Cache of the last name the client attempted to authenticate. |
177 std::string last_attempted_user_email_; | 183 std::string last_attempted_user_email_; |
178 | 184 |
179 // The error from the last signin attempt. | 185 // The error from the last signin attempt. |
180 GoogleServiceAuthError last_signin_error_; | 186 GoogleServiceAuthError last_signin_error_; |
181 | 187 |
182 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 188 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
183 }; | 189 }; |
184 | 190 |
185 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ | 191 #endif // CHROME_BROWSER_UI_WEBUI_SYNC_SETUP_HANDLER_H_ |
OLD | NEW |