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_COMPONENTS_FACTORY_IMPL_H__ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 ProfileSyncComponentsFactoryImpl( | 37 ProfileSyncComponentsFactoryImpl( |
38 Profile* profile, | 38 Profile* profile, |
39 base::CommandLine* command_line, | 39 base::CommandLine* command_line, |
40 const GURL& sync_service_url, | 40 const GURL& sync_service_url, |
41 OAuth2TokenService* token_service, | 41 OAuth2TokenService* token_service, |
42 net::URLRequestContextGetter* url_request_context_getter); | 42 net::URLRequestContextGetter* url_request_context_getter); |
43 virtual ~ProfileSyncComponentsFactoryImpl(); | 43 virtual ~ProfileSyncComponentsFactoryImpl(); |
44 | 44 |
45 virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE; | 45 virtual void RegisterDataTypes(ProfileSyncService* pss) OVERRIDE; |
46 | 46 |
47 virtual browser_sync::DataTypeManager* CreateDataTypeManager( | 47 virtual sync_driver::DataTypeManager* CreateDataTypeManager( |
48 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 48 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
49 debug_info_listener, | 49 debug_info_listener, |
50 const browser_sync::DataTypeController::TypeMap* controllers, | 50 const sync_driver::DataTypeController::TypeMap* controllers, |
51 const browser_sync::DataTypeEncryptionHandler* encryption_handler, | 51 const sync_driver::DataTypeEncryptionHandler* encryption_handler, |
52 browser_sync::SyncBackendHost* backend, | 52 browser_sync::SyncBackendHost* backend, |
53 browser_sync::DataTypeManagerObserver* observer, | 53 sync_driver::DataTypeManagerObserver* observer, |
54 browser_sync::FailedDataTypesHandler* failed_data_types_handler) | 54 sync_driver::FailedDataTypesHandler* failed_data_types_handler) |
55 OVERRIDE; | 55 OVERRIDE; |
56 | 56 |
57 virtual browser_sync::SyncBackendHost* CreateSyncBackendHost( | 57 virtual browser_sync::SyncBackendHost* CreateSyncBackendHost( |
58 const std::string& name, | 58 const std::string& name, |
59 Profile* profile, | 59 Profile* profile, |
60 invalidation::InvalidationService* invalidator, | 60 invalidation::InvalidationService* invalidator, |
61 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, | 61 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, |
62 const base::FilePath& sync_folder) OVERRIDE; | 62 const base::FilePath& sync_folder) OVERRIDE; |
63 | 63 |
64 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( | 64 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( |
65 syncer::ModelType type) OVERRIDE; | 65 syncer::ModelType type) OVERRIDE; |
66 virtual scoped_ptr<syncer::AttachmentService> CreateAttachmentService( | 66 virtual scoped_ptr<syncer::AttachmentService> CreateAttachmentService( |
67 const syncer::UserShare& user_share, | 67 const syncer::UserShare& user_share, |
68 syncer::AttachmentService::Delegate* delegate) OVERRIDE; | 68 syncer::AttachmentService::Delegate* delegate) OVERRIDE; |
69 | 69 |
70 // Legacy datatypes that need to be converted to the SyncableService API. | 70 // Legacy datatypes that need to be converted to the SyncableService API. |
71 virtual SyncComponents CreateBookmarkSyncComponents( | 71 virtual SyncComponents CreateBookmarkSyncComponents( |
72 ProfileSyncService* profile_sync_service, | 72 ProfileSyncService* profile_sync_service, |
73 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE; | 73 sync_driver::DataTypeErrorHandler* error_handler) OVERRIDE; |
74 virtual SyncComponents CreateTypedUrlSyncComponents( | 74 virtual SyncComponents CreateTypedUrlSyncComponents( |
75 ProfileSyncService* profile_sync_service, | 75 ProfileSyncService* profile_sync_service, |
76 history::HistoryBackend* history_backend, | 76 history::HistoryBackend* history_backend, |
77 browser_sync::DataTypeErrorHandler* error_handler) OVERRIDE; | 77 sync_driver::DataTypeErrorHandler* error_handler) OVERRIDE; |
78 | 78 |
79 private: | 79 private: |
80 // Register data types which are enabled on desktop platforms only. | 80 // Register data types which are enabled on desktop platforms only. |
81 // |disabled_types| and |enabled_types| correspond only to those types | 81 // |disabled_types| and |enabled_types| correspond only to those types |
82 // being explicitly enabled/disabled by the command line. | 82 // being explicitly enabled/disabled by the command line. |
83 void RegisterDesktopDataTypes(syncer::ModelTypeSet disabled_types, | 83 void RegisterDesktopDataTypes(syncer::ModelTypeSet disabled_types, |
84 syncer::ModelTypeSet enabled_types, | 84 syncer::ModelTypeSet enabled_types, |
85 ProfileSyncService* pss); | 85 ProfileSyncService* pss); |
86 // Register data types which are enabled on both desktop and mobile. | 86 // Register data types which are enabled on both desktop and mobile. |
87 // |disabled_types| and |enabled_types| correspond only to those types | 87 // |disabled_types| and |enabled_types| correspond only to those types |
88 // being explicitly enabled/disabled by the command line. | 88 // being explicitly enabled/disabled by the command line. |
89 void RegisterCommonDataTypes(syncer::ModelTypeSet disabled_types, | 89 void RegisterCommonDataTypes(syncer::ModelTypeSet disabled_types, |
90 syncer::ModelTypeSet enabled_types, | 90 syncer::ModelTypeSet enabled_types, |
91 ProfileSyncService* pss); | 91 ProfileSyncService* pss); |
92 // Used to bind a callback to give to DataTypeControllers to disable | 92 // Used to bind a callback to give to DataTypeControllers to disable |
93 // data types. | 93 // data types. |
94 browser_sync::DataTypeController::DisableTypeCallback | 94 sync_driver::DataTypeController::DisableTypeCallback |
95 MakeDisableCallbackFor(syncer::ModelType type); | 95 MakeDisableCallbackFor(syncer::ModelType type); |
96 void DisableBrokenType(syncer::ModelType type, | 96 void DisableBrokenType(syncer::ModelType type, |
97 const tracked_objects::Location& from_here, | 97 const tracked_objects::Location& from_here, |
98 const std::string& message); | 98 const std::string& message); |
99 | 99 |
100 Profile* profile_; | 100 Profile* profile_; |
101 base::CommandLine* command_line_; | 101 base::CommandLine* command_line_; |
102 // Set on the UI thread (since extensions::ExtensionSystemFactory is | 102 // Set on the UI thread (since extensions::ExtensionSystemFactory is |
103 // non-threadsafe); accessed on both the UI and FILE threads in | 103 // non-threadsafe); accessed on both the UI and FILE threads in |
104 // GetSyncableServiceForType. | 104 // GetSyncableServiceForType. |
105 extensions::ExtensionSystem* extension_system_; | 105 extensions::ExtensionSystem* extension_system_; |
106 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 106 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; |
107 | 107 |
108 const GURL sync_service_url_; | 108 const GURL sync_service_url_; |
109 OAuth2TokenService* const token_service_; | 109 OAuth2TokenService* const token_service_; |
110 net::URLRequestContextGetter* const url_request_context_getter_; | 110 net::URLRequestContextGetter* const url_request_context_getter_; |
111 | 111 |
112 base::WeakPtrFactory<ProfileSyncComponentsFactoryImpl> weak_factory_; | 112 base::WeakPtrFactory<ProfileSyncComponentsFactoryImpl> weak_factory_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl); | 114 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl); |
115 }; | 115 }; |
116 | 116 |
117 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 117 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
OLD | NEW |