Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: chrome/browser/sync/chrome_sync_client.h

Issue 1310553005: [Sync] Replace ProfileSyncComponentsFactory with SyncClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix GN Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_SYNC_CHROME_SYNC_CLIENT_H__ 5 #ifndef CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__
6 #define CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ 6 #define CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__
7 7
8 #include "components/sync_driver/sync_client.h" 8 #include "components/sync_driver/sync_client.h"
9 9
10 class ProfileSyncComponentsFactoryImpl; 10 class Profile;
11
12 namespace sync_driver {
13 class SyncApiComponentFactory;
14 class SyncService;
15 }
11 16
12 namespace browser_sync { 17 namespace browser_sync {
13 18
14 class ChromeSyncClient : public sync_driver::SyncClient { 19 class ChromeSyncClient : public sync_driver::SyncClient {
15 public: 20 public:
16 ChromeSyncClient(Profile* profile, 21 ChromeSyncClient(Profile* profile,
17 ProfileSyncComponentsFactoryImpl* component_factory); 22 sync_driver::SyncApiComponentFactory* component_factory);
18 ~ChromeSyncClient() override; 23 ~ChromeSyncClient() override;
19 24
25 // Initializes the ChromeSyncClient internal state.
26 void Initialize(sync_driver::SyncService* sync_service);
27
20 // SyncClient implementation. 28 // SyncClient implementation.
29 sync_driver::SyncService* GetSyncService() override;
21 PrefService* GetPrefService() override; 30 PrefService* GetPrefService() override;
22 bookmarks::BookmarkModel* GetBookmarkModel() override; 31 bookmarks::BookmarkModel* GetBookmarkModel() override;
23 history::HistoryService* GetHistoryService() override; 32 history::HistoryService* GetHistoryService() override;
24 scoped_refptr<password_manager::PasswordStore> GetPasswordStore() override; 33 scoped_refptr<password_manager::PasswordStore> GetPasswordStore() override;
25 autofill::PersonalDataManager* GetPersonalDataManager() override; 34 autofill::PersonalDataManager* GetPersonalDataManager() override;
26 scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override; 35 scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override;
27 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( 36 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType(
28 syncer::ModelType type) override; 37 syncer::ModelType type) override;
29 // TODO(zea): crbug.com/512768 Move the rest of these methods into
30 // SyncApiComponentFactoryImpl (all of these methods currently delegate to
31 // |component_factory_|), which will replace ProfileSyncComponentsFactoryImpl.
32 scoped_ptr<syncer::AttachmentService> CreateAttachmentService(
33 scoped_ptr<syncer::AttachmentStoreForSync> attachment_store,
34 const syncer::UserShare& user_share,
35 const std::string& store_birthday,
36 syncer::ModelType model_type,
37 syncer::AttachmentService::Delegate* delegate) override;
38 void RegisterDataTypes(ProfileSyncService* pss) override;
39 sync_driver::DataTypeManager* CreateDataTypeManager(
40 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&
41 debug_info_listener,
42 const sync_driver::DataTypeController::TypeMap* controllers,
43 const sync_driver::DataTypeEncryptionHandler* encryption_handler,
44 browser_sync::SyncBackendHost* backend,
45 sync_driver::DataTypeManagerObserver* observer) override;
46 browser_sync::SyncBackendHost* CreateSyncBackendHost(
47 const std::string& name,
48 Profile* profile,
49 invalidation::InvalidationService* invalidator,
50 const base::WeakPtr<sync_driver::SyncPrefs>& sync_prefs,
51 const base::FilePath& sync_folder) override;
52 scoped_ptr<sync_driver::LocalDeviceInfoProvider>
53 CreateLocalDeviceInfoProvider() override;
54 ProfileSyncComponentsFactory::SyncComponents CreateBookmarkSyncComponents(
55 ProfileSyncService* profile_sync_service,
56 sync_driver::DataTypeErrorHandler* error_handler) override;
57 ProfileSyncComponentsFactory::SyncComponents CreateTypedUrlSyncComponents(
58 ProfileSyncService* profile_sync_service,
59 history::HistoryBackend* history_backend,
60 sync_driver::DataTypeErrorHandler* error_handler) override;
61 38
62 // TODO(zea): crbug.com/512768 Convert this to SyncApiComponentFactoryImpl 39 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override;
63 // and make it part of the SyncClient interface.
64 ProfileSyncComponentsFactoryImpl* GetProfileSyncComponentsFactoryImpl();
65
66 40
67 private: 41 private:
68 Profile* const profile_; 42 Profile* const profile_;
69 ProfileSyncComponentsFactoryImpl* const component_factory_; 43
44 // TODO(zea): This is currently a pointer to the "parent" of this class, and
45 // is therefore not owned, but we should eventually have the SyncClient own
46 // the component factory (crbug.com/512832).
47 sync_driver::SyncApiComponentFactory* const component_factory_;
70 48
71 // Members that must be fetched on the UI thread but accessed on their 49 // Members that must be fetched on the UI thread but accessed on their
72 // respective backend threads. 50 // respective backend threads.
73 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; 51 scoped_refptr<autofill::AutofillWebDataService> web_data_service_;
74 scoped_refptr<password_manager::PasswordStore> password_store_; 52 scoped_refptr<password_manager::PasswordStore> password_store_;
53
54 // TODO(zea): this is a member only because Typed URLs needs access to
55 // the UserShare and Cryptographer outside of the UI thread. Remove this
56 // once that's no longer the case.
57 // Note: not owned.
58 sync_driver::SyncService* sync_service_;
75 }; 59 };
76 60
77 } // namespace browser_sync 61 } // namespace browser_sync
78 62
79 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ 63 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__
OLDNEW
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_sync_data_type_controller.cc ('k') | chrome/browser/sync/chrome_sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698