| 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" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } // namespace history | 35 } // namespace history |
| 36 | 36 |
| 37 namespace password_manager { | 37 namespace password_manager { |
| 38 class PasswordStore; | 38 class PasswordStore; |
| 39 } // namespace password_manager | 39 } // namespace password_manager |
| 40 | 40 |
| 41 namespace syncer { | 41 namespace syncer { |
| 42 class SyncableService; | 42 class SyncableService; |
| 43 } // namespace syncer | 43 } // namespace syncer |
| 44 | 44 |
| 45 namespace sync_sessions { |
| 46 class SyncSessionsClient; |
| 47 } // namespace sync_sessions |
| 48 |
| 45 namespace sync_driver { | 49 namespace sync_driver { |
| 46 | 50 |
| 47 class SyncApiComponentFactory; | 51 class SyncApiComponentFactory; |
| 48 class SyncService; | 52 class SyncService; |
| 49 | 53 |
| 50 // Interface for clients of the Sync API to plumb through necessary dependent | 54 // Interface for clients of the Sync API to plumb through necessary dependent |
| 51 // components. This interface is purely for abstracting dependencies, and | 55 // components. This interface is purely for abstracting dependencies, and |
| 52 // should not contain any non-trivial functional logic. | 56 // should not contain any non-trivial functional logic. |
| 53 // | 57 // |
| 54 // Note: on some platforms, getters might return nullptr. Callers are expected | 58 // Note: on some platforms, getters might return nullptr. Callers are expected |
| (...skipping 22 matching lines...) Expand all Loading... |
| 77 | 81 |
| 78 // Returns a callback that will be invoked when password sync state has | 82 // Returns a callback that will be invoked when password sync state has |
| 79 // potentially been changed. | 83 // potentially been changed. |
| 80 virtual base::Closure GetPasswordStateChangedCallback() = 0; | 84 virtual base::Closure GetPasswordStateChangedCallback() = 0; |
| 81 | 85 |
| 82 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; | 86 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; |
| 83 virtual scoped_refptr<autofill::AutofillWebDataService> | 87 virtual scoped_refptr<autofill::AutofillWebDataService> |
| 84 GetWebDataService() = 0; | 88 GetWebDataService() = 0; |
| 85 virtual BookmarkUndoService* GetBookmarkUndoServiceIfExists() = 0; | 89 virtual BookmarkUndoService* GetBookmarkUndoServiceIfExists() = 0; |
| 86 virtual scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() = 0; | 90 virtual scoped_refptr<syncer::ExtensionsActivity> GetExtensionsActivity() = 0; |
| 91 virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; |
| 87 | 92 |
| 88 // Returns a weak pointer to the syncable service specified by |type|. | 93 // Returns a weak pointer to the syncable service specified by |type|. |
| 89 // Weak pointer may be unset if service is already destroyed. | 94 // Weak pointer may be unset if service is already destroyed. |
| 90 // Note: Should only be called from the model type thread. | 95 // Note: Should only be called from the model type thread. |
| 91 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( | 96 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( |
| 92 syncer::ModelType type) = 0; | 97 syncer::ModelType type) = 0; |
| 93 | 98 |
| 94 // Creates and returns a new ModelSafeWorker for the group, or null if one | 99 // Creates and returns a new ModelSafeWorker for the group, or null if one |
| 95 // cannot be created. | 100 // cannot be created. |
| 96 // TODO(maxbogue): Move this inside SyncApiComponentFactory. | 101 // TODO(maxbogue): Move this inside SyncApiComponentFactory. |
| 97 virtual scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( | 102 virtual scoped_refptr<syncer::ModelSafeWorker> CreateModelWorkerForGroup( |
| 98 syncer::ModelSafeGroup group, | 103 syncer::ModelSafeGroup group, |
| 99 syncer::WorkerLoopDestructionObserver* observer) = 0; | 104 syncer::WorkerLoopDestructionObserver* observer) = 0; |
| 100 | 105 |
| 101 // Returns the current SyncApiComponentFactory instance. | 106 // Returns the current SyncApiComponentFactory instance. |
| 102 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; | 107 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; |
| 103 | 108 |
| 104 private: | 109 private: |
| 105 DISALLOW_COPY_AND_ASSIGN(SyncClient); | 110 DISALLOW_COPY_AND_ASSIGN(SyncClient); |
| 106 }; | 111 }; |
| 107 | 112 |
| 108 } // namespace sync_driver | 113 } // namespace sync_driver |
| 109 | 114 |
| 110 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ | 115 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ |
| OLD | NEW |