| 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 COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ |
| 6 #define COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ | 6 #define COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "components/sync_driver/sync_api_component_factory.h" | 13 #include "components/sync_driver/sync_api_component_factory.h" |
| 14 #include "sync/internal_api/public/base/model_type.h" | 14 #include "sync/internal_api/public/base/model_type.h" |
| 15 #include "sync/internal_api/public/engine/model_safe_worker.h" | 15 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 16 #include "sync/util/extensions_activity.h" | 16 #include "sync/util/extensions_activity.h" |
| 17 | 17 |
| 18 class BookmarkUndoService; | 18 class BookmarkUndoService; |
| 19 class PrefService; | 19 class PrefService; |
| 20 | 20 |
| 21 namespace autofill { | 21 namespace autofill { |
| 22 class AutofillWebDataService; | |
| 23 class AutocompleteSyncableService; | 22 class AutocompleteSyncableService; |
| 24 class PersonalDataManager; | 23 class PersonalDataManager; |
| 25 } // namespace autofill | 24 } // namespace autofill |
| 26 | 25 |
| 27 namespace bookmarks { | 26 namespace bookmarks { |
| 28 class BookmarkModel; | 27 class BookmarkModel; |
| 29 } // namespace bookmarks | 28 } // namespace bookmarks |
| 30 | 29 |
| 31 namespace favicon { | 30 namespace favicon { |
| 32 class FaviconService; | 31 class FaviconService; |
| 33 } // namespace favicon | 32 } // namespace favicon |
| 34 | 33 |
| 35 namespace history { | 34 namespace history { |
| 36 class HistoryService; | 35 class HistoryService; |
| 37 } // namespace history | 36 } // namespace history |
| 38 | 37 |
| 39 namespace invalidation { | 38 namespace invalidation { |
| 40 class InvalidationService; | 39 class InvalidationService; |
| 41 } // namespace invalidation | 40 } // namespace invalidation |
| 42 | 41 |
| 43 namespace password_manager { | |
| 44 class PasswordStore; | |
| 45 } // namespace password_manager | |
| 46 | |
| 47 namespace syncer { | 42 namespace syncer { |
| 48 class SyncableService; | 43 class SyncableService; |
| 49 } // namespace syncer | 44 } // namespace syncer |
| 50 | 45 |
| 51 namespace sync_sessions { | 46 namespace sync_sessions { |
| 52 class SyncSessionsClient; | 47 class SyncSessionsClient; |
| 53 } // namespace sync_sessions | 48 } // namespace sync_sessions |
| 54 | 49 |
| 55 namespace sync_driver { | 50 namespace sync_driver { |
| 56 | 51 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 75 // Returns the current SyncService instance. | 70 // Returns the current SyncService instance. |
| 76 virtual SyncService* GetSyncService() = 0; | 71 virtual SyncService* GetSyncService() = 0; |
| 77 | 72 |
| 78 // Returns the current profile's preference service. | 73 // Returns the current profile's preference service. |
| 79 virtual PrefService* GetPrefService() = 0; | 74 virtual PrefService* GetPrefService() = 0; |
| 80 | 75 |
| 81 // DataType specific service getters. | 76 // DataType specific service getters. |
| 82 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; | 77 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; |
| 83 virtual favicon::FaviconService* GetFaviconService() = 0; | 78 virtual favicon::FaviconService* GetFaviconService() = 0; |
| 84 virtual history::HistoryService* GetHistoryService() = 0; | 79 virtual history::HistoryService* GetHistoryService() = 0; |
| 85 virtual scoped_refptr<password_manager::PasswordStore> GetPasswordStore() = 0; | |
| 86 | 80 |
| 87 // Returns a callback that will be invoked when the sync service wishes to | 81 // Returns a callback that will be invoked when the sync service wishes to |
| 88 // have browsing data cleared. | 82 // have browsing data cleared. |
| 89 virtual ClearBrowsingDataCallback GetClearBrowsingDataCallback() = 0; | 83 virtual ClearBrowsingDataCallback GetClearBrowsingDataCallback() = 0; |
| 90 | 84 |
| 91 // Returns a callback that will register the types specific to the current | 85 // Returns a callback that will register the types specific to the current |
| 92 // platform. | 86 // platform. |
| 93 virtual sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod | 87 virtual sync_driver::SyncApiComponentFactory::RegisterDataTypesMethod |
| 94 GetRegisterPlatformTypesCallback() = 0; | 88 GetRegisterPlatformTypesCallback() = 0; |
| 95 | 89 |
| 96 // Returns a callback that will be invoked when password sync state has | 90 // Returns a callback that will be invoked when password sync state has |
| 97 // potentially been changed. | 91 // potentially been changed. |
| 98 virtual base::Closure GetPasswordStateChangedCallback() = 0; | 92 virtual base::Closure GetPasswordStateChangedCallback() = 0; |
| 99 | 93 |
| 100 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; | 94 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; |
| 101 virtual scoped_refptr<autofill::AutofillWebDataService> | |
| 102 GetWebDataService() = 0; | |
| 103 virtual BookmarkUndoService* GetBookmarkUndoServiceIfExists() = 0; | 95 virtual BookmarkUndoService* GetBookmarkUndoServiceIfExists() = 0; |
| 104 virtual invalidation::InvalidationService* GetInvalidationService() = 0; | 96 virtual invalidation::InvalidationService* GetInvalidationService() = 0; |
| 105 virtual scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() = 0; | 97 virtual scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() = 0; |
| 106 virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; | 98 virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; |
| 107 | 99 |
| 108 // Returns a weak pointer to the syncable service specified by |type|. | 100 // Returns a weak pointer to the syncable service specified by |type|. |
| 109 // Weak pointer may be unset if service is already destroyed. | 101 // Weak pointer may be unset if service is already destroyed. |
| 110 // Note: Should only be called from the model type thread. | 102 // Note: Should only be called from the model type thread. |
| 111 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( | 103 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( |
| 112 syncer::ModelType type) = 0; | 104 syncer::ModelType type) = 0; |
| 113 | 105 |
| 114 // Creates and returns a new ModelSafeWorker for the group, or null if one | 106 // Creates and returns a new ModelSafeWorker for the group, or null if one |
| 115 // cannot be created. | 107 // cannot be created. |
| 116 // TODO(maxbogue): Move this inside SyncApiComponentFactory. | 108 // TODO(maxbogue): Move this inside SyncApiComponentFactory. |
| 117 virtual scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( | 109 virtual scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( |
| 118 syncer::ModelSafeGroup group, | 110 syncer::ModelSafeGroup group, |
| 119 syncer::WorkerLoopDestructionObserver* observer) = 0; | 111 syncer::WorkerLoopDestructionObserver* observer) = 0; |
| 120 | 112 |
| 121 // Returns the current SyncApiComponentFactory instance. | 113 // Returns the current SyncApiComponentFactory instance. |
| 122 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; | 114 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; |
| 123 | 115 |
| 124 private: | 116 private: |
| 125 DISALLOW_COPY_AND_ASSIGN(SyncClient); | 117 DISALLOW_COPY_AND_ASSIGN(SyncClient); |
| 126 }; | 118 }; |
| 127 | 119 |
| 128 } // namespace sync_driver | 120 } // namespace sync_driver |
| 129 | 121 |
| 130 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ | 122 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ |
| OLD | NEW |