sync_sessions_client.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_
  5. #define COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_
  6. #include <memory>
  7. #include <string>
  8. #include "components/sync/model/model_type_store.h"
  9. class GURL;
  10. namespace sync_sessions {
  11. class LocalSessionEventRouter;
  12. class SessionSyncPrefs;
  13. class SyncedWindowDelegatesGetter;
  14. // Interface for clients of a sync sessions datatype. Should be used as a getter
  15. // for services and data the Sync Sessions datatype depends on.
  16. class SyncSessionsClient {
  17. public:
  18. SyncSessionsClient();
  19. SyncSessionsClient(const SyncSessionsClient&) = delete;
  20. SyncSessionsClient& operator=(const SyncSessionsClient&) = delete;
  21. virtual ~SyncSessionsClient();
  22. // Getters for services that sessions depends on.
  23. virtual SessionSyncPrefs* GetSessionSyncPrefs() = 0;
  24. virtual syncer::RepeatingModelTypeStoreFactory GetStoreFactory() = 0;
  25. // Clears all on demand favicons (downloaded based on synced history data).
  26. virtual void ClearAllOnDemandFavicons() = 0;
  27. // Checks if the given url is considered interesting enough to sync. Most urls
  28. // are considered interesting. Examples of ones that are not are invalid urls,
  29. // files, and chrome internal pages.
  30. // TODO(zea): make this a standalone function if the url constants are
  31. // componentized.
  32. virtual bool ShouldSyncURL(const GURL& url) const = 0;
  33. // Returns if the provided |cache_guid| is the local device's current cache\
  34. // GUID or is known to have been used in the past as local device GUID.
  35. virtual bool IsRecentLocalCacheGuid(const std::string& cache_guid) const = 0;
  36. // Returns the SyncedWindowDelegatesGetter for this client.
  37. virtual SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter() = 0;
  38. // Returns a LocalSessionEventRouter instance that is customized for the
  39. // embedder's context.
  40. virtual LocalSessionEventRouter* GetLocalSessionEventRouter() = 0;
  41. };
  42. } // namespace sync_sessions
  43. #endif // COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_