| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Terminates the sync setup flow. | 65 // Terminates the sync setup flow. |
| 66 void CloseSyncSetup(); | 66 void CloseSyncSetup(); |
| 67 | 67 |
| 68 protected: | 68 protected: |
| 69 bool is_configuring_sync() const { return configuring_sync_; } | 69 bool is_configuring_sync() const { return configuring_sync_; } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 friend class PeopleHandlerTest; | 72 friend class PeopleHandlerTest; |
| 73 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, | 73 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, |
| 74 DisplayConfigureWithBackendDisabledAndCancel); | 74 DisplayConfigureWithEngineDisabledAndCancel); |
| 75 FRIEND_TEST_ALL_PREFIXES( | 75 FRIEND_TEST_ALL_PREFIXES( |
| 76 PeopleHandlerTest, | 76 PeopleHandlerTest, |
| 77 DisplayConfigureWithBackendDisabledAndSyncStartupCompleted); | 77 DisplayConfigureWithEngineDisabledAndSyncStartupCompleted); |
| 78 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled); | 78 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled); |
| 79 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SelectCustomEncryption); | 79 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SelectCustomEncryption); |
| 80 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn); | 80 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn); |
| 81 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SuccessfullySetPassphrase); | 81 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SuccessfullySetPassphrase); |
| 82 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncEverything); | 82 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncEverything); |
| 83 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncNothing); | 83 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncNothing); |
| 84 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncAllManually); | 84 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncAllManually); |
| 85 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestPassphraseStillRequired); | 85 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestPassphraseStillRequired); |
| 86 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncIndividualTypes); | 86 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncIndividualTypes); |
| 87 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, | 87 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 virtual void DisplayGaiaLoginInNewTabOrWindow( | 153 virtual void DisplayGaiaLoginInNewTabOrWindow( |
| 154 signin_metrics::AccessPoint access_point); | 154 signin_metrics::AccessPoint access_point); |
| 155 #endif | 155 #endif |
| 156 | 156 |
| 157 // Displays spinner-only UI indicating that something is going on in the | 157 // Displays spinner-only UI indicating that something is going on in the |
| 158 // background. | 158 // background. |
| 159 // TODO(kochi): better to show some message that the user can understand what | 159 // TODO(kochi): better to show some message that the user can understand what |
| 160 // is running in the background. | 160 // is running in the background. |
| 161 void DisplaySpinner(); | 161 void DisplaySpinner(); |
| 162 | 162 |
| 163 // Displays an error dialog which shows timeout of starting the sync backend. | 163 // Displays an error dialog which shows timeout of starting the sync engine. |
| 164 void DisplayTimeout(); | 164 void DisplayTimeout(); |
| 165 | 165 |
| 166 // Closes the associated sync settings page. | 166 // Closes the associated sync settings page. |
| 167 void CloseUI(); | 167 void CloseUI(); |
| 168 | 168 |
| 169 // Pushes the updated sync prefs to JavaScript. | 169 // Pushes the updated sync prefs to JavaScript. |
| 170 void PushSyncPrefs(); | 170 void PushSyncPrefs(); |
| 171 | 171 |
| 172 // Sends the current sync status to the JavaScript WebUI code. | 172 // Sends the current sync status to the JavaScript WebUI code. |
| 173 void UpdateSyncStatus(); | 173 void UpdateSyncStatus(); |
| 174 | 174 |
| 175 // Suppresses any further signin promos, since the user has signed in once. | 175 // Suppresses any further signin promos, since the user has signed in once. |
| 176 void MarkFirstSetupComplete(); | 176 void MarkFirstSetupComplete(); |
| 177 | 177 |
| 178 // Weak pointer. | 178 // Weak pointer. |
| 179 Profile* profile_; | 179 Profile* profile_; |
| 180 | 180 |
| 181 // Helper object used to wait for the sync backend to startup. | 181 // Helper object used to wait for the sync engine to startup. |
| 182 std::unique_ptr<SyncStartupTracker> sync_startup_tracker_; | 182 std::unique_ptr<SyncStartupTracker> sync_startup_tracker_; |
| 183 | 183 |
| 184 // Prevents Sync from running until configuration is complete. | 184 // Prevents Sync from running until configuration is complete. |
| 185 std::unique_ptr<syncer::SyncSetupInProgressHandle> sync_blocker_; | 185 std::unique_ptr<syncer::SyncSetupInProgressHandle> sync_blocker_; |
| 186 | 186 |
| 187 // Set to true whenever the sync configure UI is visible. This is used to tell | 187 // Set to true whenever the sync configure UI is visible. This is used to tell |
| 188 // what stage of the setup wizard the user was in and to update the UMA | 188 // what stage of the setup wizard the user was in and to update the UMA |
| 189 // histograms in the case that the user cancels out. | 189 // histograms in the case that the user cancels out. |
| 190 bool configuring_sync_; | 190 bool configuring_sync_; |
| 191 | 191 |
| 192 // The OneShotTimer object used to timeout of starting the sync backend | 192 // The OneShotTimer object used to timeout of starting the sync engine |
| 193 // service. | 193 // service. |
| 194 std::unique_ptr<base::OneShotTimer> backend_start_timer_; | 194 std::unique_ptr<base::OneShotTimer> engine_start_timer_; |
| 195 | 195 |
| 196 // Used to listen for pref changes to allow or disallow signin. | 196 // Used to listen for pref changes to allow or disallow signin. |
| 197 PrefChangeRegistrar profile_pref_registrar_; | 197 PrefChangeRegistrar profile_pref_registrar_; |
| 198 | 198 |
| 199 // Manages observer lifetimes. | 199 // Manages observer lifetimes. |
| 200 ScopedObserver<SigninManagerBase, PeopleHandler> signin_observer_; | 200 ScopedObserver<SigninManagerBase, PeopleHandler> signin_observer_; |
| 201 ScopedObserver<browser_sync::ProfileSyncService, PeopleHandler> | 201 ScopedObserver<browser_sync::ProfileSyncService, PeopleHandler> |
| 202 sync_service_observer_; | 202 sync_service_observer_; |
| 203 | 203 |
| 204 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); | 204 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 } // namespace settings | 207 } // namespace settings |
| 208 | 208 |
| 209 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ | 209 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ |
| OLD | NEW |