OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SETTINGS_PEOPLE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 class WebContents; | 28 class WebContents; |
29 class WebUI; | 29 class WebUI; |
30 } | 30 } |
31 | 31 |
32 namespace signin_metrics { | 32 namespace signin_metrics { |
33 enum class AccessPoint; | 33 enum class AccessPoint; |
34 } | 34 } |
35 | 35 |
36 namespace sync_driver { | |
37 class SyncSetupInProgressHandle; | |
38 } | |
39 | |
40 namespace settings { | 36 namespace settings { |
41 | 37 |
42 class PeopleHandler : public SettingsPageUIHandler, | 38 class PeopleHandler : public SettingsPageUIHandler, |
43 public SigninManagerBase::Observer, | 39 public SigninManagerBase::Observer, |
44 public SyncStartupTracker::Observer, | 40 public SyncStartupTracker::Observer, |
45 public LoginUIService::LoginUI, | 41 public LoginUIService::LoginUI, |
46 public sync_driver::SyncServiceObserver { | 42 public sync_driver::SyncServiceObserver { |
47 public: | 43 public: |
48 // TODO(tommycli): Remove these strings and instead use WebUIListener events. | 44 // TODO(tommycli): Remove these strings and instead use WebUIListener events. |
49 // These string constants are used from JavaScript (sync_browser_proxy.js). | 45 // These string constants are used from JavaScript (sync_browser_proxy.js). |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 178 |
183 // Suppresses any further signin promos, since the user has signed in once. | 179 // Suppresses any further signin promos, since the user has signed in once. |
184 void MarkFirstSetupComplete(); | 180 void MarkFirstSetupComplete(); |
185 | 181 |
186 // Weak pointer. | 182 // Weak pointer. |
187 Profile* profile_; | 183 Profile* profile_; |
188 | 184 |
189 // Helper object used to wait for the sync backend to startup. | 185 // Helper object used to wait for the sync backend to startup. |
190 std::unique_ptr<SyncStartupTracker> sync_startup_tracker_; | 186 std::unique_ptr<SyncStartupTracker> sync_startup_tracker_; |
191 | 187 |
192 // Prevents Sync from running until configuration is complete. | |
193 std::unique_ptr<sync_driver::SyncSetupInProgressHandle> sync_blocker_; | |
194 | |
195 // Set to true whenever the sync configure UI is visible. This is used to tell | 188 // Set to true whenever the sync configure UI is visible. This is used to tell |
196 // what stage of the setup wizard the user was in and to update the UMA | 189 // what stage of the setup wizard the user was in and to update the UMA |
197 // histograms in the case that the user cancels out. | 190 // histograms in the case that the user cancels out. |
198 bool configuring_sync_; | 191 bool configuring_sync_; |
199 | 192 |
200 // The OneShotTimer object used to timeout of starting the sync backend | 193 // The OneShotTimer object used to timeout of starting the sync backend |
201 // service. | 194 // service. |
202 std::unique_ptr<base::OneShotTimer> backend_start_timer_; | 195 std::unique_ptr<base::OneShotTimer> backend_start_timer_; |
203 | 196 |
204 // Used to listen for pref changes to allow or disallow signin. | 197 // Used to listen for pref changes to allow or disallow signin. |
205 PrefChangeRegistrar profile_pref_registrar_; | 198 PrefChangeRegistrar profile_pref_registrar_; |
206 | 199 |
207 // Manages observer lifetimes. | 200 // Manages observer lifetimes. |
208 ScopedObserver<SigninManagerBase, PeopleHandler> signin_observer_; | 201 ScopedObserver<SigninManagerBase, PeopleHandler> signin_observer_; |
209 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_; | 202 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_; |
210 | 203 |
211 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); | 204 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); |
212 }; | 205 }; |
213 | 206 |
214 } // namespace settings | 207 } // namespace settings |
215 | 208 |
216 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ | 209 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ |
OLD | NEW |