| 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 "components/sync/base/extensions_activity.h" | 12 #include "components/sync/base/extensions_activity.h" |
| 13 #include "components/sync/base/model_type.h" | 13 #include "components/sync/base/model_type.h" |
| 14 #include "components/sync/driver/sync_api_component_factory.h" | 14 #include "components/sync/driver/sync_api_component_factory.h" |
| 15 #include "components/sync/engine/model_safe_worker.h" | 15 #include "components/sync/engine/model_safe_worker.h" |
| 16 #include "components/sync/model/model_type_service.h" | 16 #include "components/sync/model/model_type_sync_bridge.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 AutocompleteSyncableService; | 22 class AutocompleteSyncableService; |
| 23 class PersonalDataManager; | 23 class PersonalDataManager; |
| 24 } // namespace autofill | 24 } // namespace autofill |
| 25 | 25 |
| 26 namespace bookmarks { | 26 namespace bookmarks { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 virtual invalidation::InvalidationService* GetInvalidationService() = 0; | 87 virtual invalidation::InvalidationService* GetInvalidationService() = 0; |
| 88 virtual scoped_refptr<ExtensionsActivity> GetExtensionsActivity() = 0; | 88 virtual scoped_refptr<ExtensionsActivity> GetExtensionsActivity() = 0; |
| 89 virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; | 89 virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; |
| 90 | 90 |
| 91 // Returns a weak pointer to the syncable service specified by |type|. | 91 // Returns a weak pointer to the syncable service specified by |type|. |
| 92 // Weak pointer may be unset if service is already destroyed. | 92 // Weak pointer may be unset if service is already destroyed. |
| 93 // Note: Should only be dereferenced from the model type thread. | 93 // Note: Should only be dereferenced from the model type thread. |
| 94 virtual base::WeakPtr<SyncableService> GetSyncableServiceForType( | 94 virtual base::WeakPtr<SyncableService> GetSyncableServiceForType( |
| 95 ModelType type) = 0; | 95 ModelType type) = 0; |
| 96 | 96 |
| 97 // Returns a weak pointer to the ModelTypeService specified by |type|. Weak | 97 // Returns a weak pointer to the ModelTypeSyncBridge specified by |type|. Weak |
| 98 // pointer may be unset if service is already destroyed. | 98 // pointer may be unset if service is already destroyed. |
| 99 // Note: Should only be dereferenced from the model type thread. | 99 // Note: Should only be dereferenced from the model type thread. |
| 100 virtual base::WeakPtr<ModelTypeService> GetModelTypeServiceForType( | 100 virtual base::WeakPtr<ModelTypeSyncBridge> GetSyncBridgeForModelType( |
| 101 ModelType type) = 0; | 101 ModelType type) = 0; |
| 102 | 102 |
| 103 // Creates and returns a new ModelSafeWorker for the group, or null if one | 103 // Creates and returns a new ModelSafeWorker for the group, or null if one |
| 104 // cannot be created. | 104 // cannot be created. |
| 105 // TODO(maxbogue): Move this inside SyncApiComponentFactory. | 105 // TODO(maxbogue): Move this inside SyncApiComponentFactory. |
| 106 virtual scoped_refptr<ModelSafeWorker> CreateModelWorkerForGroup( | 106 virtual scoped_refptr<ModelSafeWorker> CreateModelWorkerForGroup( |
| 107 ModelSafeGroup group, | 107 ModelSafeGroup group, |
| 108 WorkerLoopDestructionObserver* observer) = 0; | 108 WorkerLoopDestructionObserver* observer) = 0; |
| 109 | 109 |
| 110 // Returns the current SyncApiComponentFactory instance. | 110 // Returns the current SyncApiComponentFactory instance. |
| 111 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; | 111 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 DISALLOW_COPY_AND_ASSIGN(SyncClient); | 114 DISALLOW_COPY_AND_ASSIGN(SyncClient); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace syncer | 117 } // namespace syncer |
| 118 | 118 |
| 119 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ | 119 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ |
| OLD | NEW |