OLD | NEW |
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 syncer::ModelType type) override; | 56 syncer::ModelType type) override; |
57 scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( | 57 scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( |
58 syncer::ModelSafeGroup group, | 58 syncer::ModelSafeGroup group, |
59 syncer::WorkerLoopDestructionObserver* observer) override; | 59 syncer::WorkerLoopDestructionObserver* observer) override; |
60 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override; | 60 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override; |
61 | 61 |
62 // Helpers for overriding getters in tests. | 62 // Helpers for overriding getters in tests. |
63 void SetBrowsingDataRemoverObserverForTesting( | 63 void SetBrowsingDataRemoverObserverForTesting( |
64 BrowsingDataRemover::Observer* observer); | 64 BrowsingDataRemover::Observer* observer); |
65 void SetSyncApiComponentFactoryForTesting( | 65 void SetSyncApiComponentFactoryForTesting( |
66 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory); | 66 std::unique_ptr<sync_driver::SyncApiComponentFactory> component_factory); |
67 | 67 |
68 // Iterates over all of the profiles that have been loaded so far, and | 68 // Iterates over all of the profiles that have been loaded so far, and |
69 // extracts their tracker if present. If some profiles don't have trackers, no | 69 // extracts their tracker if present. If some profiles don't have trackers, no |
70 // indication is given in the passed vector. | 70 // indication is given in the passed vector. |
71 static void GetDeviceInfoTrackers( | 71 static void GetDeviceInfoTrackers( |
72 std::vector<const sync_driver::DeviceInfoTracker*>* trackers); | 72 std::vector<const sync_driver::DeviceInfoTracker*>* trackers); |
73 | 73 |
74 private: | 74 private: |
75 // Register data types which are enabled on desktop platforms only. | 75 // Register data types which are enabled on desktop platforms only. |
76 // |disabled_types| and |enabled_types| correspond only to those types | 76 // |disabled_types| and |enabled_types| correspond only to those types |
77 // being explicitly disabled/enabled by the command line. | 77 // being explicitly disabled/enabled by the command line. |
78 void RegisterDesktopDataTypes(sync_driver::SyncService* sync_service, | 78 void RegisterDesktopDataTypes(sync_driver::SyncService* sync_service, |
79 syncer::ModelTypeSet disabled_types, | 79 syncer::ModelTypeSet disabled_types, |
80 syncer::ModelTypeSet enabled_types); | 80 syncer::ModelTypeSet enabled_types); |
81 | 81 |
82 // Register data types which are enabled on Android platforms only. | 82 // Register data types which are enabled on Android platforms only. |
83 // |disabled_types| and |enabled_types| correspond only to those types | 83 // |disabled_types| and |enabled_types| correspond only to those types |
84 // being explicitly disabled/enabled by the command line. | 84 // being explicitly disabled/enabled by the command line. |
85 void RegisterAndroidDataTypes(sync_driver::SyncService* sync_service, | 85 void RegisterAndroidDataTypes(sync_driver::SyncService* sync_service, |
86 syncer::ModelTypeSet disabled_types, | 86 syncer::ModelTypeSet disabled_types, |
87 syncer::ModelTypeSet enabled_types); | 87 syncer::ModelTypeSet enabled_types); |
88 | 88 |
89 Profile* const profile_; | 89 Profile* const profile_; |
90 | 90 |
91 // The sync api component factory in use by this client. | 91 // The sync api component factory in use by this client. |
92 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory_; | 92 std::unique_ptr<sync_driver::SyncApiComponentFactory> component_factory_; |
93 | 93 |
94 // Members that must be fetched on the UI thread but accessed on their | 94 // Members that must be fetched on the UI thread but accessed on their |
95 // respective backend threads. | 95 // respective backend threads. |
96 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; | 96 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; |
97 scoped_refptr<password_manager::PasswordStore> password_store_; | 97 scoped_refptr<password_manager::PasswordStore> password_store_; |
98 | 98 |
99 scoped_ptr<sync_sessions::SyncSessionsClient> sync_sessions_client_; | 99 std::unique_ptr<sync_sessions::SyncSessionsClient> sync_sessions_client_; |
100 | 100 |
101 // Generates and monitors the ExtensionsActivity object used by sync. | 101 // Generates and monitors the ExtensionsActivity object used by sync. |
102 ExtensionsActivityMonitor extensions_activity_monitor_; | 102 ExtensionsActivityMonitor extensions_activity_monitor_; |
103 | 103 |
104 // Used in integration tests. | 104 // Used in integration tests. |
105 BrowsingDataRemover::Observer* browsing_data_remover_observer_; | 105 BrowsingDataRemover::Observer* browsing_data_remover_observer_; |
106 | 106 |
107 base::WeakPtrFactory<ChromeSyncClient> weak_ptr_factory_; | 107 base::WeakPtrFactory<ChromeSyncClient> weak_ptr_factory_; |
108 | 108 |
109 DISALLOW_COPY_AND_ASSIGN(ChromeSyncClient); | 109 DISALLOW_COPY_AND_ASSIGN(ChromeSyncClient); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace browser_sync | 112 } // namespace browser_sync |
113 | 113 |
114 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ | 114 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ |
OLD | NEW |