| 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 "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/timer.h" | 10 #include "base/timer/timer.h" |
| 11 #include "chrome/browser/sync/sync_startup_tracker.h" | 11 #include "chrome/browser/sync/sync_startup_tracker.h" |
| 12 #include "chrome/browser/ui/webui/options/options_ui.h" | 12 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 13 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 13 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 14 | 14 |
| 15 class LoginUIService; | 15 class LoginUIService; |
| 16 class ProfileManager; | |
| 17 class ProfileSyncService; | 16 class ProfileSyncService; |
| 18 class SigninManagerBase; | 17 class SigninManagerBase; |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 class WebContents; | 20 class WebContents; |
| 22 } | 21 } |
| 23 | 22 |
| 24 class SyncSetupHandler : public options::OptionsPageUIHandler, | 23 class SyncSetupHandler : public options::OptionsPageUIHandler, |
| 25 public SyncStartupTracker::Observer, | 24 public SyncStartupTracker::Observer, |
| 26 public LoginUIService::LoginUI { | 25 public LoginUIService::LoginUI { |
| 27 public: | 26 public: |
| 28 // Constructs a new SyncSetupHandler. |profile_manager| may be NULL. | 27 SyncSetupHandler(); |
| 29 explicit SyncSetupHandler(ProfileManager* profile_manager); | |
| 30 ~SyncSetupHandler() override; | 28 ~SyncSetupHandler() override; |
| 31 | 29 |
| 32 // OptionsPageUIHandler implementation. | 30 // OptionsPageUIHandler implementation. |
| 33 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; | 31 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
| 34 void RegisterMessages() override; | 32 void RegisterMessages() override; |
| 35 | 33 |
| 36 // SyncStartupTracker::Observer implementation; | 34 // SyncStartupTracker::Observer implementation; |
| 37 void SyncStartupCompleted() override; | 35 void SyncStartupCompleted() override; |
| 38 void SyncStartupFailed() override; | 36 void SyncStartupFailed() override; |
| 39 | 37 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void DisplayConfigureSync(bool passphrase_failed); | 143 void DisplayConfigureSync(bool passphrase_failed); |
| 146 | 144 |
| 147 // Helper object used to wait for the sync backend to startup. | 145 // Helper object used to wait for the sync backend to startup. |
| 148 scoped_ptr<SyncStartupTracker> sync_startup_tracker_; | 146 scoped_ptr<SyncStartupTracker> sync_startup_tracker_; |
| 149 | 147 |
| 150 // Set to true whenever the sync configure UI is visible. This is used to tell | 148 // Set to true whenever the sync configure UI is visible. This is used to tell |
| 151 // what stage of the setup wizard the user was in and to update the UMA | 149 // what stage of the setup wizard the user was in and to update the UMA |
| 152 // histograms in the case that the user cancels out. | 150 // histograms in the case that the user cancels out. |
| 153 bool configuring_sync_; | 151 bool configuring_sync_; |
| 154 | 152 |
| 155 // Weak reference to the profile manager. | |
| 156 ProfileManager* const profile_manager_; | |
| 157 | |
| 158 // The OneShotTimer object used to timeout of starting the sync backend | 153 // The OneShotTimer object used to timeout of starting the sync backend |
| 159 // service. | 154 // service. |
| 160 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; | 155 scoped_ptr<base::OneShotTimer<SyncSetupHandler> > backend_start_timer_; |
| 161 | 156 |
| 162 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); | 157 DISALLOW_COPY_AND_ASSIGN(SyncSetupHandler); |
| 163 }; | 158 }; |
| 164 | 159 |
| 165 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ | 160 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_SYNC_SETUP_HANDLER_H_ |
| OLD | NEW |