| 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 COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 std::unique_ptr<SigninManagerWrapper> signin_wrapper; | 239 std::unique_ptr<SigninManagerWrapper> signin_wrapper; |
| 240 ProfileOAuth2TokenService* oauth2_token_service = nullptr; | 240 ProfileOAuth2TokenService* oauth2_token_service = nullptr; |
| 241 GaiaCookieManagerService* gaia_cookie_manager_service = nullptr; | 241 GaiaCookieManagerService* gaia_cookie_manager_service = nullptr; |
| 242 StartBehavior start_behavior = MANUAL_START; | 242 StartBehavior start_behavior = MANUAL_START; |
| 243 syncer::NetworkTimeUpdateCallback network_time_update_callback; | 243 syncer::NetworkTimeUpdateCallback network_time_update_callback; |
| 244 base::FilePath base_directory; | 244 base::FilePath base_directory; |
| 245 scoped_refptr<net::URLRequestContextGetter> url_request_context; | 245 scoped_refptr<net::URLRequestContextGetter> url_request_context; |
| 246 std::string debug_identifier; | 246 std::string debug_identifier; |
| 247 version_info::Channel channel = version_info::Channel::UNKNOWN; | 247 version_info::Channel channel = version_info::Channel::UNKNOWN; |
| 248 base::SequencedWorkerPool* blocking_pool = nullptr; | 248 base::SequencedWorkerPool* blocking_pool = nullptr; |
| 249 base::FilePath local_sync_backend_folder; |
| 249 | 250 |
| 250 private: | 251 private: |
| 251 DISALLOW_COPY_AND_ASSIGN(InitParams); | 252 DISALLOW_COPY_AND_ASSIGN(InitParams); |
| 252 }; | 253 }; |
| 253 | 254 |
| 254 explicit ProfileSyncService(InitParams init_params); | 255 explicit ProfileSyncService(InitParams init_params); |
| 255 | 256 |
| 256 ~ProfileSyncService() override; | 257 ~ProfileSyncService() override; |
| 257 | 258 |
| 258 // Initializes the object. This must be called at most once, and | 259 // Initializes the object. This must be called at most once, and |
| 259 // immediately after an object of this class is constructed. | 260 // immediately after an object of this class is constructed. |
| 260 void Initialize(); | 261 void Initialize(); |
| 261 | 262 |
| 262 // syncer::SyncService implementation | 263 // syncer::SyncService implementation |
| 263 bool IsFirstSetupComplete() const override; | 264 bool IsFirstSetupComplete() const override; |
| 264 bool IsSyncAllowed() const override; | 265 bool IsSyncAllowed() const override; |
| 265 bool IsSyncActive() const override; | 266 bool IsSyncActive() const override; |
| 267 bool IsLocalSyncEnabled() const override; |
| 266 void TriggerRefresh(const syncer::ModelTypeSet& types) override; | 268 void TriggerRefresh(const syncer::ModelTypeSet& types) override; |
| 267 void OnDataTypeRequestsSyncStartup(syncer::ModelType type) override; | 269 void OnDataTypeRequestsSyncStartup(syncer::ModelType type) override; |
| 268 bool CanSyncStart() const override; | 270 bool CanSyncStart() const override; |
| 269 void RequestStop(SyncStopDataFate data_fate) override; | 271 void RequestStop(SyncStopDataFate data_fate) override; |
| 270 void RequestStart() override; | 272 void RequestStart() override; |
| 271 syncer::ModelTypeSet GetActiveDataTypes() const override; | 273 syncer::ModelTypeSet GetActiveDataTypes() const override; |
| 272 syncer::SyncClient* GetSyncClient() const override; | 274 syncer::SyncClient* GetSyncClient() const override; |
| 273 syncer::ModelTypeSet GetPreferredDataTypes() const override; | 275 syncer::ModelTypeSet GetPreferredDataTypes() const override; |
| 274 void OnUserChoseDatatypes(bool sync_everything, | 276 void OnUserChoseDatatypes(bool sync_everything, |
| 275 syncer::ModelTypeSet chosen_types) override; | 277 syncer::ModelTypeSet chosen_types) override; |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 | 833 |
| 832 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents | 834 // Set when sync receives DISABLED_BY_ADMIN error from server. Prevents |
| 833 // ProfileSyncService from starting engine till browser restarted or user | 835 // ProfileSyncService from starting engine till browser restarted or user |
| 834 // signed out. | 836 // signed out. |
| 835 bool sync_disabled_by_admin_; | 837 bool sync_disabled_by_admin_; |
| 836 | 838 |
| 837 // Set to true if a signin has completed but we're still waiting for the | 839 // Set to true if a signin has completed but we're still waiting for the |
| 838 // engine to refresh its credentials. | 840 // engine to refresh its credentials. |
| 839 bool is_auth_in_progress_; | 841 bool is_auth_in_progress_; |
| 840 | 842 |
| 843 // The location where the local sync backend stores its data. |
| 844 base::FilePath local_sync_backend_folder_; |
| 845 |
| 841 // Encapsulates user signin - used to set/get the user's authenticated | 846 // Encapsulates user signin - used to set/get the user's authenticated |
| 842 // email address. | 847 // email address. |
| 843 const std::unique_ptr<SigninManagerWrapper> signin_; | 848 const std::unique_ptr<SigninManagerWrapper> signin_; |
| 844 | 849 |
| 845 // Information describing an unrecoverable error. | 850 // Information describing an unrecoverable error. |
| 846 UnrecoverableErrorReason unrecoverable_error_reason_; | 851 UnrecoverableErrorReason unrecoverable_error_reason_; |
| 847 std::string unrecoverable_error_message_; | 852 std::string unrecoverable_error_message_; |
| 848 tracked_objects::Location unrecoverable_error_location_; | 853 tracked_objects::Location unrecoverable_error_location_; |
| 849 | 854 |
| 850 // Manages the start and stop of the data types. | 855 // Manages the start and stop of the data types. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 992 base::WeakPtrFactory<ProfileSyncService> weak_factory_; | 997 base::WeakPtrFactory<ProfileSyncService> weak_factory_; |
| 993 | 998 |
| 994 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 999 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 995 }; | 1000 }; |
| 996 | 1001 |
| 997 bool ShouldShowActionOnUI(const syncer::SyncProtocolError& error); | 1002 bool ShouldShowActionOnUI(const syncer::SyncProtocolError& error); |
| 998 | 1003 |
| 999 } // namespace browser_sync | 1004 } // namespace browser_sync |
| 1000 | 1005 |
| 1001 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 1006 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |