| 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_SESSIONS_SYNC_SESSIONS_CLIENT_H_ | 5 #ifndef COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_ |
| 6 #define COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_ | 6 #define COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 | 13 |
| 14 namespace bookmarks { | 14 namespace bookmarks { |
| 15 class BookmarkModel; | 15 class BookmarkModel; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace browser_sync { | |
| 19 class LocalSessionEventRouter; | |
| 20 class SyncedWindowDelegatesGetter; | |
| 21 } | |
| 22 | |
| 23 namespace favicon { | 18 namespace favicon { |
| 24 class FaviconService; | 19 class FaviconService; |
| 25 } | 20 } |
| 26 | 21 |
| 27 namespace history { | 22 namespace history { |
| 28 class HistoryService; | 23 class HistoryService; |
| 29 } | 24 } |
| 30 | 25 |
| 31 namespace sync_sessions { | 26 namespace sync_sessions { |
| 32 | 27 |
| 28 class LocalSessionEventRouter; |
| 29 class SyncedWindowDelegatesGetter; |
| 30 |
| 33 // Interface for clients of a sync sessions datatype. Should be used as a getter | 31 // Interface for clients of a sync sessions datatype. Should be used as a getter |
| 34 // for services and data the Sync Sessions datatype depends on. | 32 // for services and data the Sync Sessions datatype depends on. |
| 35 class SyncSessionsClient { | 33 class SyncSessionsClient { |
| 36 public: | 34 public: |
| 37 SyncSessionsClient(); | 35 SyncSessionsClient(); |
| 38 virtual ~SyncSessionsClient(); | 36 virtual ~SyncSessionsClient(); |
| 39 | 37 |
| 40 // Getters for services that sessions depends on. | 38 // Getters for services that sessions depends on. |
| 41 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; | 39 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0; |
| 42 virtual favicon::FaviconService* GetFaviconService() = 0; | 40 virtual favicon::FaviconService* GetFaviconService() = 0; |
| 43 virtual history::HistoryService* GetHistoryService() = 0; | 41 virtual history::HistoryService* GetHistoryService() = 0; |
| 44 | 42 |
| 45 // Checks if the given url is considered interesting enough to sync. Most urls | 43 // Checks if the given url is considered interesting enough to sync. Most urls |
| 46 // are considered interesting. Examples of ones that are not are invalid urls, | 44 // are considered interesting. Examples of ones that are not are invalid urls, |
| 47 // files, and chrome internal pages. | 45 // files, and chrome internal pages. |
| 48 // TODO(zea): make this a standalone function if the url constants are | 46 // TODO(zea): make this a standalone function if the url constants are |
| 49 // componentized. | 47 // componentized. |
| 50 virtual bool ShouldSyncURL(const GURL& url) const = 0; | 48 virtual bool ShouldSyncURL(const GURL& url) const = 0; |
| 51 | 49 |
| 52 // Returns the SyncedWindowDelegatesGetter for this client. | 50 // Returns the SyncedWindowDelegatesGetter for this client. |
| 53 virtual browser_sync::SyncedWindowDelegatesGetter* | 51 virtual SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter() = 0; |
| 54 GetSyncedWindowDelegatesGetter() = 0; | |
| 55 | 52 |
| 56 // Returns a LocalSessionEventRouter instance that is customized for the | 53 // Returns a LocalSessionEventRouter instance that is customized for the |
| 57 // embedder's context. | 54 // embedder's context. |
| 58 virtual std::unique_ptr<browser_sync::LocalSessionEventRouter> | 55 virtual std::unique_ptr<LocalSessionEventRouter> |
| 59 GetLocalSessionEventRouter() = 0; | 56 GetLocalSessionEventRouter() = 0; |
| 60 | 57 |
| 61 // TODO(zea): add getters for the history and favicon services for the favicon | 58 // TODO(zea): add getters for the history and favicon services for the favicon |
| 62 // cache to consume once it's componentized. | 59 // cache to consume once it's componentized. |
| 63 | 60 |
| 64 private: | 61 private: |
| 65 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClient); | 62 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClient); |
| 66 }; | 63 }; |
| 67 | 64 |
| 68 } // namespace sync_sessions | 65 } // namespace sync_sessions |
| 69 | 66 |
| 70 #endif // COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_ | 67 #endif // COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_ |
| OLD | NEW |