Chromium Code Reviews| 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_SYNC_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 #include "sync/internal_api/public/engine/model_safe_worker.h" | 47 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 48 #include "sync/internal_api/public/sync_manager_factory.h" | 48 #include "sync/internal_api/public/sync_manager_factory.h" |
| 49 #include "sync/internal_api/public/util/experiments.h" | 49 #include "sync/internal_api/public/util/experiments.h" |
| 50 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 50 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
| 51 #include "sync/js/sync_js_controller.h" | 51 #include "sync/js/sync_js_controller.h" |
| 52 #include "url/gurl.h" | 52 #include "url/gurl.h" |
| 53 | 53 |
| 54 class Profile; | 54 class Profile; |
| 55 class ProfileOAuth2TokenService; | 55 class ProfileOAuth2TokenService; |
| 56 class ProfileSyncComponentsFactory; | 56 class ProfileSyncComponentsFactory; |
| 57 class ProfileSyncServiceDataTypeProvider; | |
| 57 class SupervisedUserSigninManagerWrapper; | 58 class SupervisedUserSigninManagerWrapper; |
| 58 class SyncErrorController; | 59 class SyncErrorController; |
| 59 | 60 |
| 60 namespace base { | 61 namespace base { |
| 61 class CommandLine; | 62 class CommandLine; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 namespace browser_sync { | 65 namespace browser_sync { |
| 65 class BackendMigrator; | 66 class BackendMigrator; |
| 66 class DeviceInfo; | 67 class DeviceInfo; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 ProfileSyncServiceBase::Observer* observer) const OVERRIDE; | 294 ProfileSyncServiceBase::Observer* observer) const OVERRIDE; |
| 294 | 295 |
| 295 | 296 |
| 296 void AddProtocolEventObserver(browser_sync::ProtocolEventObserver* observer); | 297 void AddProtocolEventObserver(browser_sync::ProtocolEventObserver* observer); |
| 297 void RemoveProtocolEventObserver( | 298 void RemoveProtocolEventObserver( |
| 298 browser_sync::ProtocolEventObserver* observer); | 299 browser_sync::ProtocolEventObserver* observer); |
| 299 | 300 |
| 300 void AddTypeDebugInfoObserver(syncer::TypeDebugInfoObserver* observer); | 301 void AddTypeDebugInfoObserver(syncer::TypeDebugInfoObserver* observer); |
| 301 void RemoveTypeDebugInfoObserver(syncer::TypeDebugInfoObserver* observer); | 302 void RemoveTypeDebugInfoObserver(syncer::TypeDebugInfoObserver* observer); |
| 302 | 303 |
| 304 void AddDataTypeProvider(ProfileSyncServiceDataTypeProvider* provider); | |
| 305 void RemoveDataTypeProvider(ProfileSyncServiceDataTypeProvider* provider); | |
| 306 bool HasDataTypeProvider(ProfileSyncServiceDataTypeProvider* provider) const; | |
| 307 | |
| 303 // Asynchronously fetches base::Value representations of all sync nodes and | 308 // Asynchronously fetches base::Value representations of all sync nodes and |
| 304 // returns them to the specified callback on this thread. | 309 // returns them to the specified callback on this thread. |
| 305 // | 310 // |
| 306 // These requests can live a long time and return when you least expect it. | 311 // These requests can live a long time and return when you least expect it. |
| 307 // For safety, the callback should be bound to some sort of WeakPtr<> or | 312 // For safety, the callback should be bound to some sort of WeakPtr<> or |
| 308 // scoped_refptr<>. | 313 // scoped_refptr<>. |
| 309 void GetAllNodes( | 314 void GetAllNodes( |
| 310 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback); | 315 const base::Callback<void(scoped_ptr<base::ListValue>)>& callback); |
| 311 | 316 |
| 312 void RegisterAuthNotifications(); | 317 void RegisterAuthNotifications(); |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 912 void RegisterNewDataType(syncer::ModelType data_type); | 917 void RegisterNewDataType(syncer::ModelType data_type); |
| 913 | 918 |
| 914 // Reconfigures the data type manager with the latest enabled types. | 919 // Reconfigures the data type manager with the latest enabled types. |
| 915 // Note: Does not initialize the backend if it is not already initialized. | 920 // Note: Does not initialize the backend if it is not already initialized. |
| 916 // This function needs to be called only after sync has been initialized | 921 // This function needs to be called only after sync has been initialized |
| 917 // (i.e.,only for reconfigurations). The reason we don't initialize the | 922 // (i.e.,only for reconfigurations). The reason we don't initialize the |
| 918 // backend is because if we had encountered an unrecoverable error we don't | 923 // backend is because if we had encountered an unrecoverable error we don't |
| 919 // want to startup once more. | 924 // want to startup once more. |
| 920 virtual void ReconfigureDatatypeManager(); | 925 virtual void ReconfigureDatatypeManager(); |
| 921 | 926 |
| 927 // Collects required sync data types from |data_type_providers_|. | |
| 928 syncer::ModelTypeSet GetRequiredDataTypes(); | |
|
Marc Treib
2014/07/30 11:42:50
Might have to make this public, so the UI can adap
| |
| 929 | |
| 922 // Called when the user changes the sync configuration, to update the UMA | 930 // Called when the user changes the sync configuration, to update the UMA |
| 923 // stats. | 931 // stats. |
| 924 void UpdateSelectedTypesHistogram( | 932 void UpdateSelectedTypesHistogram( |
| 925 bool sync_everything, | 933 bool sync_everything, |
| 926 const syncer::ModelTypeSet chosen_types) const; | 934 const syncer::ModelTypeSet chosen_types) const; |
| 927 | 935 |
| 928 #if defined(OS_CHROMEOS) | 936 #if defined(OS_CHROMEOS) |
| 929 // Refresh spare sync bootstrap token for re-enabling the sync service. | 937 // Refresh spare sync bootstrap token for re-enabling the sync service. |
| 930 // Called on successful sign-in notifications. | 938 // Called on successful sign-in notifications. |
| 931 void RefreshSpareBootstrapToken(const std::string& passphrase); | 939 void RefreshSpareBootstrapToken(const std::string& passphrase); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1016 // Manages the start and stop of the directory data types. | 1024 // Manages the start and stop of the directory data types. |
| 1017 scoped_ptr<sync_driver::DataTypeManager> directory_data_type_manager_; | 1025 scoped_ptr<sync_driver::DataTypeManager> directory_data_type_manager_; |
| 1018 | 1026 |
| 1019 // Manager for the non-blocking data types. | 1027 // Manager for the non-blocking data types. |
| 1020 sync_driver::NonBlockingDataTypeManager non_blocking_data_type_manager_; | 1028 sync_driver::NonBlockingDataTypeManager non_blocking_data_type_manager_; |
| 1021 | 1029 |
| 1022 ObserverList<ProfileSyncServiceBase::Observer> observers_; | 1030 ObserverList<ProfileSyncServiceBase::Observer> observers_; |
| 1023 ObserverList<browser_sync::ProtocolEventObserver> protocol_event_observers_; | 1031 ObserverList<browser_sync::ProtocolEventObserver> protocol_event_observers_; |
| 1024 ObserverList<syncer::TypeDebugInfoObserver> type_debug_info_observers_; | 1032 ObserverList<syncer::TypeDebugInfoObserver> type_debug_info_observers_; |
| 1025 | 1033 |
| 1034 std::list<ProfileSyncServiceDataTypeProvider*> data_type_providers_; | |
| 1035 | |
| 1026 syncer::SyncJsController sync_js_controller_; | 1036 syncer::SyncJsController sync_js_controller_; |
| 1027 | 1037 |
| 1028 // This allows us to gracefully handle an ABORTED return code from the | 1038 // This allows us to gracefully handle an ABORTED return code from the |
| 1029 // DataTypeManager in the event that the server informed us to cease and | 1039 // DataTypeManager in the event that the server informed us to cease and |
| 1030 // desist syncing immediately. | 1040 // desist syncing immediately. |
| 1031 bool expect_sync_configuration_aborted_; | 1041 bool expect_sync_configuration_aborted_; |
| 1032 | 1042 |
| 1033 // Sometimes we need to temporarily hold on to a passphrase because we don't | 1043 // Sometimes we need to temporarily hold on to a passphrase because we don't |
| 1034 // yet have a backend to send it to. This happens during initialization as | 1044 // yet have a backend to send it to. This happens during initialization as |
| 1035 // we don't StartUp until we have a valid token, which happens after valid | 1045 // we don't StartUp until we have a valid token, which happens after valid |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1136 scoped_ptr<base::Time> last_backup_time_; | 1146 scoped_ptr<base::Time> last_backup_time_; |
| 1137 | 1147 |
| 1138 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); | 1148 DISALLOW_COPY_AND_ASSIGN(ProfileSyncService); |
| 1139 }; | 1149 }; |
| 1140 | 1150 |
| 1141 bool ShouldShowActionOnUI( | 1151 bool ShouldShowActionOnUI( |
| 1142 const syncer::SyncProtocolError& error); | 1152 const syncer::SyncProtocolError& error); |
| 1143 | 1153 |
| 1144 | 1154 |
| 1145 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ | 1155 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |