| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Terminates the sync setup flow. | 58 // Terminates the sync setup flow. |
| 59 void CloseSyncSetup(); | 59 void CloseSyncSetup(); |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 bool is_configuring_sync() const { return configuring_sync_; } | 62 bool is_configuring_sync() const { return configuring_sync_; } |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 friend class PeopleHandlerTest; | 65 friend class PeopleHandlerTest; |
| 66 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, | 66 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, |
| 67 DisplayConfigureWithBackendDisabledAndCancel); | 67 DisplayConfigureWithBackendDisabledAndCancel); |
| 68 FRIEND_TEST_ALL_PREFIXES( |
| 69 PeopleHandlerTest, |
| 70 DisplayConfigureWithBackendDisabledAndSyncStartupCompleted); |
| 68 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled); | 71 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, HandleSetupUIWhenSyncDisabled); |
| 69 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SelectCustomEncryption); | 72 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SelectCustomEncryption); |
| 70 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn); | 73 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, ShowSyncSetupWhenNotSignedIn); |
| 71 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SuccessfullySetPassphrase); | 74 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, SuccessfullySetPassphrase); |
| 72 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncEverything); | 75 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncEverything); |
| 73 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncNothing); | 76 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncNothing); |
| 74 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncAllManually); | 77 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncAllManually); |
| 75 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestPassphraseStillRequired); | 78 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestPassphraseStillRequired); |
| 76 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncIndividualTypes); | 79 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, TestSyncIndividualTypes); |
| 77 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, | 80 FRIEND_TEST_ALL_PREFIXES(PeopleHandlerTest, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 105 // SigninManagerBase::Observer implementation. | 108 // SigninManagerBase::Observer implementation. |
| 106 void GoogleSigninSucceeded(const std::string& account_id, | 109 void GoogleSigninSucceeded(const std::string& account_id, |
| 107 const std::string& username, | 110 const std::string& username, |
| 108 const std::string& password) override; | 111 const std::string& password) override; |
| 109 void GoogleSignedOut(const std::string& account_id, | 112 void GoogleSignedOut(const std::string& account_id, |
| 110 const std::string& username) override; | 113 const std::string& username) override; |
| 111 | 114 |
| 112 // sync_driver::SyncServiceObserver implementation. | 115 // sync_driver::SyncServiceObserver implementation. |
| 113 void OnStateChanged() override; | 116 void OnStateChanged() override; |
| 114 | 117 |
| 115 // Shows advanced configuration dialog without going through sign in dialog. | |
| 116 // Kicks the sync backend if necessary with showing spinner dialog until it | |
| 117 // gets ready. | |
| 118 void OpenConfigureSync(); | |
| 119 | |
| 120 // Returns a newly created dictionary with a number of properties that | 118 // Returns a newly created dictionary with a number of properties that |
| 121 // correspond to the status of sync. | 119 // correspond to the status of sync. |
| 122 std::unique_ptr<base::DictionaryValue> GetSyncStatusDictionary(); | 120 std::unique_ptr<base::DictionaryValue> GetSyncStatusDictionary(); |
| 123 | 121 |
| 124 // Helper routine that gets the ProfileSyncService associated with the parent | 122 // Helper routine that gets the ProfileSyncService associated with the parent |
| 125 // profile. | 123 // profile. |
| 126 ProfileSyncService* GetSyncService() const; | 124 ProfileSyncService* GetSyncService() const; |
| 127 | 125 |
| 128 // Returns the LoginUIService for the parent profile. | 126 // Returns the LoginUIService for the parent profile. |
| 129 LoginUIService* GetLoginUIService() const; | 127 LoginUIService* GetLoginUIService() const; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // histograms in the case that the user cancels out. | 191 // histograms in the case that the user cancels out. |
| 194 bool configuring_sync_; | 192 bool configuring_sync_; |
| 195 | 193 |
| 196 // The OneShotTimer object used to timeout of starting the sync backend | 194 // The OneShotTimer object used to timeout of starting the sync backend |
| 197 // service. | 195 // service. |
| 198 std::unique_ptr<base::OneShotTimer> backend_start_timer_; | 196 std::unique_ptr<base::OneShotTimer> backend_start_timer_; |
| 199 | 197 |
| 200 // Used to listen for pref changes to allow or disallow signin. | 198 // Used to listen for pref changes to allow or disallow signin. |
| 201 PrefChangeRegistrar profile_pref_registrar_; | 199 PrefChangeRegistrar profile_pref_registrar_; |
| 202 | 200 |
| 203 // Manages observer lifetime. | 201 // Manages observer lifetimes. |
| 202 ScopedObserver<SigninManagerBase, PeopleHandler> signin_observer_; |
| 204 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_; | 203 ScopedObserver<ProfileSyncService, PeopleHandler> sync_service_observer_; |
| 205 | 204 |
| 206 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); | 205 DISALLOW_COPY_AND_ASSIGN(PeopleHandler); |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 } // namespace settings | 208 } // namespace settings |
| 210 | 209 |
| 211 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ | 210 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_PEOPLE_HANDLER_H_ |
| OLD | NEW |