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_OPTIONS_SYNC_SETUP_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/browser/sync/sync_startup_tracker.h" | 14 #include "chrome/browser/sync/sync_startup_tracker.h" |
15 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
16 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 16 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
17 | 17 |
18 class LoginUIService; | 18 class LoginUIService; |
| 19 class SigninManagerBase; |
| 20 |
| 21 namespace browser_sync { |
19 class ProfileSyncService; | 22 class ProfileSyncService; |
20 class SigninManagerBase; | 23 } // namespace browser_sync |
21 | 24 |
22 namespace content { | 25 namespace content { |
23 class WebContents; | 26 class WebContents; |
24 } | 27 } // namespace content |
25 | 28 |
26 namespace signin_metrics { | 29 namespace signin_metrics { |
27 enum class AccessPoint; | 30 enum class AccessPoint; |
28 } | 31 } // namespace signin_metrics |
29 | 32 |
30 namespace sync_driver { | 33 namespace sync_driver { |
31 class SyncSetupInProgressHandle; | 34 class SyncSetupInProgressHandle; |
32 } | 35 } // namespace sync_driver |
33 | 36 |
34 class SyncSetupHandler : public options::OptionsPageUIHandler, | 37 class SyncSetupHandler : public options::OptionsPageUIHandler, |
35 public SyncStartupTracker::Observer, | 38 public SyncStartupTracker::Observer, |
36 public LoginUIService::LoginUI { | 39 public LoginUIService::LoginUI { |
37 public: | 40 public: |
38 SyncSetupHandler(); | 41 SyncSetupHandler(); |
39 ~SyncSetupHandler() override; | 42 ~SyncSetupHandler() override; |
40 | 43 |
41 // OptionsPageUIHandler implementation. | 44 // OptionsPageUIHandler implementation. |
42 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 45 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 SubmitAuthWithInvalidUsername); | 93 SubmitAuthWithInvalidUsername); |
91 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin); | 94 FRIEND_TEST_ALL_PREFIXES(SyncSetupHandlerFirstSigninTest, DisplayBasicLogin); |
92 | 95 |
93 bool is_configuring_sync() const { return configuring_sync_; } | 96 bool is_configuring_sync() const { return configuring_sync_; } |
94 | 97 |
95 // Called when configuring sync is done to close the dialog and start syncing. | 98 // Called when configuring sync is done to close the dialog and start syncing. |
96 void ConfigureSyncDone(); | 99 void ConfigureSyncDone(); |
97 | 100 |
98 // Helper routine that gets the ProfileSyncService associated with the parent | 101 // Helper routine that gets the ProfileSyncService associated with the parent |
99 // profile. | 102 // profile. |
100 ProfileSyncService* GetSyncService() const; | 103 browser_sync::ProfileSyncService* GetSyncService() const; |
101 | 104 |
102 // Returns the LoginUIService for the parent profile. | 105 // Returns the LoginUIService for the parent profile. |
103 LoginUIService* GetLoginUIService() const; | 106 LoginUIService* GetLoginUIService() const; |
104 | 107 |
105 private: | 108 private: |
106 // Callbacks from the page. | 109 // Callbacks from the page. |
107 void OnDidClosePage(const base::ListValue* args); | 110 void OnDidClosePage(const base::ListValue* args); |
108 void HandleConfigure(const base::ListValue* args); | 111 void HandleConfigure(const base::ListValue* args); |
109 void HandlePassphraseEntry(const base::ListValue* args); | 112 void HandlePassphraseEntry(const base::ListValue* args); |
110 void HandlePassphraseCancel(const base::ListValue* args); | 113 void HandlePassphraseCancel(const base::ListValue* args); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 bool configuring_sync_; | 171 bool configuring_sync_; |
169 | 172 |
170 // The OneShotTimer object used to timeout of starting the sync backend | 173 // The OneShotTimer object used to timeout of starting the sync backend |
171 // service. | 174 // service. |
172 std::unique_ptr<base::OneShotTimer> backend_start_timer_; | 175 std::unique_ptr<base::OneShotTimer> backend_start_timer_; |
173 | 176 |
174 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 177 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
175 }; | 178 }; |
176 | 179 |
177 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ | 180 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ |
OLD | NEW |