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

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

Issue 1451023005: Revert of [Sync] Componentize ProfileSyncComponentsFactoryImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/browsing_data/browsing_data_remover.h" 9 #include "chrome/browser/browsing_data/browsing_data_remover.h"
10 #include "chrome/browser/sync/glue/extensions_activity_monitor.h" 10 #include "chrome/browser/sync/glue/extensions_activity_monitor.h"
11 #include "components/sync_driver/sync_client.h" 11 #include "components/sync_driver/sync_client.h"
12 12
13 class Profile; 13 class Profile;
14 14
15 namespace sync_driver { 15 namespace sync_driver {
16 class SyncApiComponentFactory; 16 class SyncApiComponentFactory;
17 class SyncService; 17 class SyncService;
18 } 18 }
19 19
20 namespace browser_sync { 20 namespace browser_sync {
21 21
22 class ChromeSyncClient : public sync_driver::SyncClient { 22 class ChromeSyncClient : public sync_driver::SyncClient {
23 public: 23 public:
24 explicit ChromeSyncClient(Profile* profile); 24 ChromeSyncClient(
25 Profile* profile,
26 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory);
25 ~ChromeSyncClient() override; 27 ~ChromeSyncClient() override;
26 28
27 // SyncClient implementation. 29 // SyncClient implementation.
28 void Initialize(sync_driver::SyncService* sync_service) override; 30 void Initialize(sync_driver::SyncService* sync_service) override;
29 sync_driver::SyncService* GetSyncService() override; 31 sync_driver::SyncService* GetSyncService() override;
30 PrefService* GetPrefService() override; 32 PrefService* GetPrefService() override;
31 bookmarks::BookmarkModel* GetBookmarkModel() override; 33 bookmarks::BookmarkModel* GetBookmarkModel() override;
32 favicon::FaviconService* GetFaviconService() override; 34 favicon::FaviconService* GetFaviconService() override;
33 history::HistoryService* GetHistoryService() override; 35 history::HistoryService* GetHistoryService() override;
34 scoped_refptr<password_manager::PasswordStore> GetPasswordStore() override; 36 scoped_refptr<password_manager::PasswordStore> GetPasswordStore() override;
35 sync_driver::ClearBrowsingDataCallback GetClearBrowsingDataCallback() 37 sync_driver::ClearBrowsingDataCallback GetClearBrowsingDataCallback()
36 override; 38 override;
37 base::Closure GetPasswordStateChangedCallback() override; 39 base::Closure GetPasswordStateChangedCallback() override;
38 sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod
39 GetRegisterPlatformTypesCallback() override;
40 autofill::PersonalDataManager* GetPersonalDataManager() override; 40 autofill::PersonalDataManager* GetPersonalDataManager() override;
41 invalidation::InvalidationService* GetInvalidationService() override; 41 invalidation::InvalidationService* GetInvalidationService() override;
42 scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override; 42 scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override;
43 BookmarkUndoService* GetBookmarkUndoServiceIfExists() override; 43 BookmarkUndoService* GetBookmarkUndoServiceIfExists() override;
44 scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() override; 44 scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() override;
45 sync_sessions::SyncSessionsClient* GetSyncSessionsClient() override; 45 sync_sessions::SyncSessionsClient* GetSyncSessionsClient() override;
46 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( 46 base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType(
47 syncer::ModelType type) override; 47 syncer::ModelType type) override;
48 scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( 48 scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup(
49 syncer::ModelSafeGroup group, 49 syncer::ModelSafeGroup group,
50 syncer::WorkerLoopDestructionObserver* observer) override; 50 syncer::WorkerLoopDestructionObserver* observer) override;
51 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override; 51 sync_driver::SyncApiComponentFactory* GetSyncApiComponentFactory() override;
52 52
53 // Helpers for overriding getters in tests. 53 // Helper for testing rollback.
54 void SetBrowsingDataRemoverObserverForTesting( 54 void SetBrowsingDataRemoverObserverForTesting(
55 BrowsingDataRemover::Observer* observer); 55 BrowsingDataRemover::Observer* observer);
56 void SetSyncApiComponentFactoryForTesting(
57 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory);
58 56
59 private: 57 private:
60 // Register data types which are enabled on desktop platforms only. 58 Profile* const profile_;
61 // |disabled_types| and |enabled_types| correspond only to those types
62 // being explicitly disabled/enabled by the command line.
63 void RegisterDesktopDataTypes(syncer::ModelTypeSet disabled_types,
64 syncer::ModelTypeSet enabled_types);
65
66 // Register data types which are enabled on Android platforms only.
67 // |disabled_types| and |enabled_types| correspond only to those types
68 // being explicitly disabled/enabled by the command line.
69 void RegisterAndroidDataTypes(syncer::ModelTypeSet disabled_types,
70 syncer::ModelTypeSet enabled_types);
71 59
72 void ClearBrowsingData(base::Time start, base::Time end); 60 void ClearBrowsingData(base::Time start, base::Time end);
73 61
74 Profile* const profile_;
75
76 // The sync api component factory in use by this client. 62 // The sync api component factory in use by this client.
77 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory_; 63 scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory_;
78 64
79 // Members that must be fetched on the UI thread but accessed on their 65 // Members that must be fetched on the UI thread but accessed on their
80 // respective backend threads. 66 // respective backend threads.
81 scoped_refptr<autofill::AutofillWebDataService> web_data_service_; 67 scoped_refptr<autofill::AutofillWebDataService> web_data_service_;
82 scoped_refptr<password_manager::PasswordStore> password_store_; 68 scoped_refptr<password_manager::PasswordStore> password_store_;
83 69
84 scoped_ptr<sync_sessions::SyncSessionsClient> sync_sessions_client_; 70 scoped_ptr<sync_sessions::SyncSessionsClient> sync_sessions_client_;
85 71
86 // TODO(zea): this is a member only because Typed URLs needs access to 72 // TODO(zea): this is a member only because Typed URLs needs access to
87 // the UserShare and Cryptographer outside of the UI thread. Remove this 73 // the UserShare and Cryptographer outside of the UI thread. Remove this
88 // once that's no longer the case. 74 // once that's no longer the case.
89 // Note: not owned. 75 // Note: not owned.
90 sync_driver::SyncService* sync_service_; 76 sync_driver::SyncService* sync_service_;
91 77
92 // Generates and monitors the ExtensionsActivity object used by sync. 78 // Generates and monitors the ExtensionsActivity object used by sync.
93 ExtensionsActivityMonitor extensions_activity_monitor_; 79 ExtensionsActivityMonitor extensions_activity_monitor_;
94 80
95 // Used in integration tests. 81 // Used in integration tests.
96 BrowsingDataRemover::Observer* browsing_data_remover_observer_; 82 BrowsingDataRemover::Observer* browsing_data_remover_observer_;
97 83
98 base::WeakPtrFactory<ChromeSyncClient> weak_ptr_factory_;
99
100 DISALLOW_COPY_AND_ASSIGN(ChromeSyncClient); 84 DISALLOW_COPY_AND_ASSIGN(ChromeSyncClient);
101 }; 85 };
102 86
103 } // namespace browser_sync 87 } // namespace browser_sync
104 88
105 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__ 89 #endif // CHROME_BROWSER_SYNC_CHROME_SYNC_CLIENT_H__
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/sessions/sessions_apitest.cc ('k') | chrome/browser/sync/chrome_sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698