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_COMPONENTS_FACTORY_IMPL_H__ | 5 #ifndef COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 class PasswordStore; | 28 class PasswordStore; |
29 } | 29 } |
30 | 30 |
31 namespace net { | 31 namespace net { |
32 class URLRequestContextGetter; | 32 class URLRequestContextGetter; |
33 } | 33 } |
34 | 34 |
35 namespace browser_sync { | 35 namespace browser_sync { |
36 | 36 |
37 class ProfileSyncComponentsFactoryImpl | 37 class ProfileSyncComponentsFactoryImpl |
38 : public syncer::SyncApiComponentFactory { | 38 : public sync_driver::SyncApiComponentFactory { |
39 public: | 39 public: |
40 // Constructs a ProfileSyncComponentsFactoryImpl. | 40 // Constructs a ProfileSyncComponentsFactoryImpl. |
41 // | 41 // |
42 // |sync_service_url| is the base URL of the sync server. | 42 // |sync_service_url| is the base URL of the sync server. |
43 // | 43 // |
44 // |token_service| must outlive the ProfileSyncComponentsFactoryImpl. | 44 // |token_service| must outlive the ProfileSyncComponentsFactoryImpl. |
45 // | 45 // |
46 // |url_request_context_getter| must outlive the | 46 // |url_request_context_getter| must outlive the |
47 // ProfileSyncComponentsFactoryImpl. | 47 // ProfileSyncComponentsFactoryImpl. |
48 ProfileSyncComponentsFactoryImpl( | 48 ProfileSyncComponentsFactoryImpl( |
49 syncer::SyncClient* sync_client, | 49 sync_driver::SyncClient* sync_client, |
50 version_info::Channel channel, | 50 version_info::Channel channel, |
51 const std::string& version, | 51 const std::string& version, |
52 bool is_tablet, | 52 bool is_tablet, |
53 const base::CommandLine& command_line, | 53 const base::CommandLine& command_line, |
54 const char* history_disabled_pref, | 54 const char* history_disabled_pref, |
55 const GURL& sync_service_url, | 55 const GURL& sync_service_url, |
56 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, | 56 const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread, |
57 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, | 57 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
58 OAuth2TokenService* token_service, | 58 OAuth2TokenService* token_service, |
59 net::URLRequestContextGetter* url_request_context_getter, | 59 net::URLRequestContextGetter* url_request_context_getter, |
60 const scoped_refptr<autofill::AutofillWebDataService>& web_data_service, | 60 const scoped_refptr<autofill::AutofillWebDataService>& web_data_service, |
61 const scoped_refptr<password_manager::PasswordStore>& password_store); | 61 const scoped_refptr<password_manager::PasswordStore>& password_store); |
62 ~ProfileSyncComponentsFactoryImpl() override; | 62 ~ProfileSyncComponentsFactoryImpl() override; |
63 | 63 |
64 // SyncApiComponentFactory implementation: | 64 // SyncApiComponentFactory implementation: |
65 void RegisterDataTypes( | 65 void RegisterDataTypes( |
66 syncer::SyncService* sync_service, | 66 sync_driver::SyncService* sync_service, |
67 const RegisterDataTypesMethod& register_platform_types_method) override; | 67 const RegisterDataTypesMethod& register_platform_types_method) override; |
68 syncer::DataTypeManager* CreateDataTypeManager( | 68 sync_driver::DataTypeManager* CreateDataTypeManager( |
69 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 69 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
70 debug_info_listener, | 70 debug_info_listener, |
71 const syncer::DataTypeController::TypeMap* controllers, | 71 const sync_driver::DataTypeController::TypeMap* controllers, |
72 const syncer::DataTypeEncryptionHandler* encryption_handler, | 72 const sync_driver::DataTypeEncryptionHandler* encryption_handler, |
73 syncer::SyncBackendHost* backend, | 73 SyncBackendHost* backend, |
74 syncer::DataTypeManagerObserver* observer) override; | 74 sync_driver::DataTypeManagerObserver* observer) override; |
75 syncer::SyncBackendHost* CreateSyncBackendHost( | 75 SyncBackendHost* CreateSyncBackendHost( |
76 const std::string& name, | 76 const std::string& name, |
77 invalidation::InvalidationService* invalidator, | 77 invalidation::InvalidationService* invalidator, |
78 const base::WeakPtr<syncer::SyncPrefs>& sync_prefs, | 78 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs, |
79 const base::FilePath& sync_folder) override; | 79 const base::FilePath& sync_folder) override; |
80 std::unique_ptr<syncer::LocalDeviceInfoProvider> | 80 std::unique_ptr<sync_driver::LocalDeviceInfoProvider> |
81 CreateLocalDeviceInfoProvider() override; | 81 CreateLocalDeviceInfoProvider() override; |
82 std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( | 82 std::unique_ptr<syncer::AttachmentService> CreateAttachmentService( |
83 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, | 83 std::unique_ptr<syncer::AttachmentStoreForSync> attachment_store, |
84 const syncer::UserShare& user_share, | 84 const syncer::UserShare& user_share, |
85 const std::string& store_birthday, | 85 const std::string& store_birthday, |
86 syncer::ModelType model_type, | 86 syncer::ModelType model_type, |
87 syncer::AttachmentService::Delegate* delegate) override; | 87 syncer::AttachmentService::Delegate* delegate) override; |
88 syncer::SyncApiComponentFactory::SyncComponents CreateBookmarkSyncComponents( | 88 sync_driver::SyncApiComponentFactory::SyncComponents |
89 syncer::SyncService* sync_service, | 89 CreateBookmarkSyncComponents( |
| 90 sync_driver::SyncService* sync_service, |
90 std::unique_ptr<syncer::DataTypeErrorHandler> error_handler) override; | 91 std::unique_ptr<syncer::DataTypeErrorHandler> error_handler) override; |
91 | 92 |
92 // Sets a bit that determines whether PREFERENCES should be registered with a | 93 // Sets a bit that determines whether PREFERENCES should be registered with a |
93 // ModelTypeController for testing purposes. | 94 // ModelTypeController for testing purposes. |
94 static void OverridePrefsForUssTest(bool use_uss); | 95 static void OverridePrefsForUssTest(bool use_uss); |
95 | 96 |
96 private: | 97 private: |
97 // Register data types which are enabled on both desktop and mobile. | 98 // Register data types which are enabled on both desktop and mobile. |
98 // |disabled_types| and |enabled_types| correspond only to those types | 99 // |disabled_types| and |enabled_types| correspond only to those types |
99 // being explicitly enabled/disabled by the command line. | 100 // being explicitly enabled/disabled by the command line. |
100 void RegisterCommonDataTypes(syncer::SyncService* sync_service, | 101 void RegisterCommonDataTypes(sync_driver::SyncService* sync_service, |
101 syncer::ModelTypeSet disabled_types, | 102 syncer::ModelTypeSet disabled_types, |
102 syncer::ModelTypeSet enabled_types); | 103 syncer::ModelTypeSet enabled_types); |
103 | 104 |
104 void DisableBrokenType(syncer::ModelType type, | 105 void DisableBrokenType(syncer::ModelType type, |
105 const tracked_objects::Location& from_here, | 106 const tracked_objects::Location& from_here, |
106 const std::string& message); | 107 const std::string& message); |
107 | 108 |
108 // Client/platform specific members. | 109 // Client/platform specific members. |
109 syncer::SyncClient* const sync_client_; | 110 sync_driver::SyncClient* const sync_client_; |
110 const version_info::Channel channel_; | 111 const version_info::Channel channel_; |
111 const std::string version_; | 112 const std::string version_; |
112 const bool is_tablet_; | 113 const bool is_tablet_; |
113 const base::CommandLine command_line_; | 114 const base::CommandLine command_line_; |
114 const char* history_disabled_pref_; | 115 const char* history_disabled_pref_; |
115 const GURL sync_service_url_; | 116 const GURL sync_service_url_; |
116 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; | 117 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; |
117 const scoped_refptr<base::SingleThreadTaskRunner> db_thread_; | 118 const scoped_refptr<base::SingleThreadTaskRunner> db_thread_; |
118 OAuth2TokenService* const token_service_; | 119 OAuth2TokenService* const token_service_; |
119 net::URLRequestContextGetter* const url_request_context_getter_; | 120 net::URLRequestContextGetter* const url_request_context_getter_; |
120 const scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 121 const scoped_refptr<autofill::AutofillWebDataService> web_data_service_; |
121 const scoped_refptr<password_manager::PasswordStore> password_store_; | 122 const scoped_refptr<password_manager::PasswordStore> password_store_; |
122 | 123 |
123 base::WeakPtrFactory<ProfileSyncComponentsFactoryImpl> weak_factory_; | 124 base::WeakPtrFactory<ProfileSyncComponentsFactoryImpl> weak_factory_; |
124 | 125 |
125 // Whether to override PREFERENCES to use USS. | 126 // Whether to override PREFERENCES to use USS. |
126 static bool override_prefs_controller_to_uss_for_test_; | 127 static bool override_prefs_controller_to_uss_for_test_; |
127 | 128 |
128 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl); | 129 DISALLOW_COPY_AND_ASSIGN(ProfileSyncComponentsFactoryImpl); |
129 }; | 130 }; |
130 | 131 |
131 } // namespace browser_sync | 132 } // namespace browser_sync |
132 | 133 |
133 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ | 134 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_COMPONENTS_FACTORY_IMPL_H__ |
OLD | NEW |