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

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

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