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

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

Issue 2388673002: Revert of [Sync] Move //components/sync to the syncer namespace. (patchset #5 id:40001 of https://co (Closed)
Patch Set: Created 4 years, 2 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 <memory>
9 #include <vector> 8 #include <vector>
10 9
11 #include "base/macros.h" 10 #include "base/macros.h"
12 #include "chrome/browser/sync/glue/extensions_activity_monitor.h" 11 #include "chrome/browser/sync/glue/extensions_activity_monitor.h"
13 #include "components/sync/driver/sync_client.h" 12 #include "components/sync/driver/sync_client.h"
14 13
15 class Profile; 14 class Profile;
16 15
17 namespace autofill { 16 namespace autofill {
18 class AutofillWebDataService; 17 class AutofillWebDataService;
19 } 18 }
20 19
21 namespace password_manager { 20 namespace password_manager {
22 class PasswordStore; 21 class PasswordStore;
23 } 22 }
24 23
25 namespace syncer { 24 namespace sync_driver {
26 class DeviceInfoTracker; 25 class DeviceInfoTracker;
27 class SyncApiComponentFactory; 26 class SyncApiComponentFactory;
28 class SyncService; 27 class SyncService;
29 } 28 }
30 29
31 namespace browser_sync { 30 namespace browser_sync {
32 31
33 class ChromeSyncClient : public syncer::SyncClient { 32 class ChromeSyncClient : public sync_driver::SyncClient {
34 public: 33 public:
35 explicit ChromeSyncClient(Profile* profile); 34 explicit ChromeSyncClient(Profile* profile);
36 ~ChromeSyncClient() override; 35 ~ChromeSyncClient() override;
37 36
38 // SyncClient implementation. 37 // SyncClient implementation.
39 void Initialize() override; 38 void Initialize() override;
40 syncer::SyncService* GetSyncService() override; 39 sync_driver::SyncService* GetSyncService() override;
41 PrefService* GetPrefService() override; 40 PrefService* GetPrefService() override;
42 bookmarks::BookmarkModel* GetBookmarkModel() override; 41 bookmarks::BookmarkModel* GetBookmarkModel() override;
43 favicon::FaviconService* GetFaviconService() override; 42 favicon::FaviconService* GetFaviconService() override;
44 history::HistoryService* GetHistoryService() override; 43 history::HistoryService* GetHistoryService() override;
45 base::Closure GetPasswordStateChangedCallback() override; 44 base::Closure GetPasswordStateChangedCallback() override;
46 syncer::SyncApiComponentFactory::RegisterDataTypesMethod 45 sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod
47 GetRegisterPlatformTypesCallback() override; 46 GetRegisterPlatformTypesCallback() override;
48 autofill::PersonalDataManager* GetPersonalDataManager() override; 47 autofill::PersonalDataManager* GetPersonalDataManager() override;
49 invalidation::InvalidationService* GetInvalidationService() override; 48 invalidation::InvalidationService* GetInvalidationService() override;
50 BookmarkUndoService* GetBookmarkUndoServiceIfExists() override; 49 BookmarkUndoService* GetBookmarkUndoServiceIfExists() override;
51 scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() override; 50 scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() override;
52 sync_sessions::SyncSessionsClient* GetSyncSessionsClient() override; 51 sync_sessions::SyncSessionsClient* GetSyncSessionsClient() override;
53 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( 52 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType(
54 syncer::ModelType type) override; 53 syncer::ModelType type) override;
55 base::WeakPtr<syncer::ModelTypeService> GetModelTypeServiceForType( 54 base::WeakPtr<syncer_v2::ModelTypeService> GetModelTypeServiceForType(
56 syncer::ModelType type) override; 55 syncer::ModelType type) override;
57 scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( 56 scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup(
58 syncer::ModelSafeGroup group, 57 syncer::ModelSafeGroup group,
59 syncer::WorkerLoopDestructionObserver* observer) override; 58 syncer::WorkerLoopDestructionObserver* observer) override;
60 syncer::SyncApiComponentFactory* GetSyncApiComponentFactory() override; 59 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override;
61 60
62 // Helpers for overriding getters in tests. 61 // Helpers for overriding getters in tests.
63 void SetSyncApiComponentFactoryForTesting( 62 void SetSyncApiComponentFactoryForTesting(
64 std::unique_ptr<syncer::SyncApiComponentFactory> component_factory); 63 std::unique_ptr<sync_driver::SyncApiComponentFactory> component_factory);
65 64
66 // Iterates over all of the profiles that have been loaded so far, and 65 // Iterates over all of the profiles that have been loaded so far, and
67 // extracts their tracker if present. If some profiles don't have trackers, no 66 // extracts their tracker if present. If some profiles don't have trackers, no
68 // indication is given in the passed vector. 67 // indication is given in the passed vector.
69 static void GetDeviceInfoTrackers( 68 static void GetDeviceInfoTrackers(
70 std::vector<const syncer::DeviceInfoTracker*>* trackers); 69 std::vector<const sync_driver::DeviceInfoTracker*>* trackers);
71 70
72 private: 71 private:
73 // Register data types which are enabled on desktop platforms only. 72 // Register data types which are enabled on desktop platforms only.
74 // |disabled_types| and |enabled_types| correspond only to those types 73 // |disabled_types| and |enabled_types| correspond only to those types
75 // being explicitly disabled/enabled by the command line. 74 // being explicitly disabled/enabled by the command line.
76 void RegisterDesktopDataTypes(syncer::SyncService* sync_service, 75 void RegisterDesktopDataTypes(sync_driver::SyncService* sync_service,
77 syncer::ModelTypeSet disabled_types, 76 syncer::ModelTypeSet disabled_types,
78 syncer::ModelTypeSet enabled_types); 77 syncer::ModelTypeSet enabled_types);
79 78
80 // Register data types which are enabled on Android platforms only. 79 // Register data types which are enabled on Android platforms only.
81 // |disabled_types| and |enabled_types| correspond only to those types 80 // |disabled_types| and |enabled_types| correspond only to those types
82 // being explicitly disabled/enabled by the command line. 81 // being explicitly disabled/enabled by the command line.
83 void RegisterAndroidDataTypes(syncer::SyncService* sync_service, 82 void RegisterAndroidDataTypes(sync_driver::SyncService* sync_service,
84 syncer::ModelTypeSet disabled_types, 83 syncer::ModelTypeSet disabled_types,
85 syncer::ModelTypeSet enabled_types); 84 syncer::ModelTypeSet enabled_types);
86 85
87 Profile* const profile_; 86 Profile* const profile_;
88 87
89 // The sync api component factory in use by this client. 88 // The sync api component factory in use by this client.
90 std::unique_ptr<syncer::SyncApiComponentFactory> component_factory_; 89 std::unique_ptr<sync_driver::SyncApiComponentFactory> component_factory_;
91 90
92 // Members that must be fetched on the UI thread but accessed on their 91 // Members that must be fetched on the UI thread but accessed on their
93 // respective backend threads. 92 // respective backend threads.
94 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; 93 scoped_refptr<autofill::AutofillWebDataService> web_data_service_;
95 scoped_refptr<password_manager::PasswordStore> password_store_; 94 scoped_refptr<password_manager::PasswordStore> password_store_;
96 95
97 std::unique_ptr<sync_sessions::SyncSessionsClient> sync_sessions_client_; 96 std::unique_ptr<sync_sessions::SyncSessionsClient> sync_sessions_client_;
98 97
99 // Generates and monitors the ExtensionsActivity object used by sync. 98 // Generates and monitors the ExtensionsActivity object used by sync.
100 ExtensionsActivityMonitor extensions_activity_monitor_; 99 ExtensionsActivityMonitor extensions_activity_monitor_;
101 100
102 base::WeakPtrFactory<ChromeSyncClient> weak_ptr_factory_; 101 base::WeakPtrFactory<ChromeSyncClient> weak_ptr_factory_;
103 102
104 DISALLOW_COPY_AND_ASSIGN(ChromeSyncClient); 103 DISALLOW_COPY_AND_ASSIGN(ChromeSyncClient);
105 }; 104 };
106 105
107 } // namespace browser_sync 106 } // namespace browser_sync
108 107
109 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ 108 #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