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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } // namespace history | 32 } // namespace history |
33 | 33 |
34 namespace password_manager { | 34 namespace password_manager { |
35 class PasswordStore; | 35 class PasswordStore; |
36 } // namespace password_manager | 36 } // namespace password_manager |
37 | 37 |
38 namespace syncer { | 38 namespace syncer { |
39 class SyncableService; | 39 class SyncableService; |
40 } // namespace syncer | 40 } // namespace syncer |
41 | 41 |
| 42 namespace sync_sessions { |
| 43 class SyncSessionsClient; |
| 44 } // namespace sync_sessions |
| 45 |
42 namespace sync_driver { | 46 namespace sync_driver { |
43 | 47 |
44 class SyncApiComponentFactory; | 48 class SyncApiComponentFactory; |
45 class SyncService; | 49 class SyncService; |
46 | 50 |
47 // Interface for clients of the Sync API to plumb through necessary dependent | 51 // Interface for clients of the Sync API to plumb through necessary dependent |
48 // components. This interface is purely for abstracting dependencies, and | 52 // components. This interface is purely for abstracting dependencies, and |
49 // should not contain any non-trivial functional logic. | 53 // should not contain any non-trivial functional logic. |
50 // | 54 // |
51 // Note: on some platforms, getters might return nullptr. Callers are expected | 55 // Note: on some platforms, getters might return nullptr. Callers are expected |
(...skipping 16 matching lines...) Expand all Loading... |
68 | 72 |
69 // DataType specific service getters. | 73 // DataType specific service getters. |
70 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; | 74 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; |
71 virtual favicon::FaviconService* GetFaviconService() = 0; | 75 virtual favicon::FaviconService* GetFaviconService() = 0; |
72 virtual history::HistoryService* GetHistoryService() = 0; | 76 virtual history::HistoryService* GetHistoryService() = 0; |
73 virtual scoped_refptr<password_manager::PasswordStore> GetPasswordStore() = 0; | 77 virtual scoped_refptr<password_manager::PasswordStore> GetPasswordStore() = 0; |
74 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; | 78 virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0; |
75 virtual scoped_refptr<autofill::AutofillWebDataService> | 79 virtual scoped_refptr<autofill::AutofillWebDataService> |
76 GetWebDataService() = 0; | 80 GetWebDataService() = 0; |
77 virtual BookmarkUndoService* GetBookmarkUndoServiceIfExists() = 0; | 81 virtual BookmarkUndoService* GetBookmarkUndoServiceIfExists() = 0; |
| 82 virtual sync_sessions::SyncSessionsClient* GetSyncSessionsClient() = 0; |
78 | 83 |
79 // Returns a weak pointer to the syncable service specified by |type|. | 84 // Returns a weak pointer to the syncable service specified by |type|. |
80 // Weak pointer may be unset if service is already destroyed. | 85 // Weak pointer may be unset if service is already destroyed. |
81 // Note: Should only be called from the model type thread. | 86 // Note: Should only be called from the model type thread. |
82 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( | 87 virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( |
83 syncer::ModelType type) = 0; | 88 syncer::ModelType type) = 0; |
84 | 89 |
85 // Returns the current SyncApiComponentFactory instance. | 90 // Returns the current SyncApiComponentFactory instance. |
86 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; | 91 virtual SyncApiComponentFactory* GetSyncApiComponentFactory() = 0; |
87 | 92 |
88 private: | 93 private: |
89 DISALLOW_COPY_AND_ASSIGN(SyncClient); | 94 DISALLOW_COPY_AND_ASSIGN(SyncClient); |
90 }; | 95 }; |
91 | 96 |
92 } // namespace sync_driver | 97 } // namespace sync_driver |
93 | 98 |
94 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ | 99 #endif // COMPONENTS_SYNC_DRIVER_SYNC_CLIENT_H_ |
OLD | NEW |