blob: e8b4874a78419c2cc80257c86300b10b0d5f7eea [file] [log] [blame]
zeaf09345c2015-10-27 05:29:501// 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
5#ifndef COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_
6#define COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_
7
danakj5b9c7ed62016-04-22 23:33:378#include <memory>
9
zeaf09345c2015-10-27 05:29:5010#include "base/macros.h"
11
12class GURL;
13
zea9c7707d2015-11-03 21:41:1414namespace bookmarks {
15class BookmarkModel;
16}
17
zea9c7707d2015-11-03 21:41:1418namespace favicon {
19class FaviconService;
20}
21
22namespace history {
23class HistoryService;
24}
25
zeaf09345c2015-10-27 05:29:5026namespace sync_sessions {
27
maxboguea79d99b72016-09-15 15:59:1628class LocalSessionEventRouter;
29class SyncedWindowDelegatesGetter;
30
zeaf09345c2015-10-27 05:29:5031// Interface for clients of a sync sessions datatype. Should be used as a getter
32// for services and data the Sync Sessions datatype depends on.
33class SyncSessionsClient {
34 public:
35 SyncSessionsClient();
36 virtual ~SyncSessionsClient();
37
zea9c7707d2015-11-03 21:41:1438 // Getters for services that sessions depends on.
39 virtual bookmarks::BookmarkModel* GetBookmarkModel() = 0;
40 virtual favicon::FaviconService* GetFaviconService() = 0;
41 virtual history::HistoryService* GetHistoryService() = 0;
42
zeaf09345c2015-10-27 05:29:5043 // Checks if the given url is considered interesting enough to sync. Most urls
44 // are considered interesting. Examples of ones that are not are invalid urls,
45 // files, and chrome internal pages.
46 // TODO(zea): make this a standalone function if the url constants are
47 // componentized.
48 virtual bool ShouldSyncURL(const GURL& url) const = 0;
49
50 // Returns the SyncedWindowDelegatesGetter for this client.
maxboguea79d99b72016-09-15 15:59:1651 virtual SyncedWindowDelegatesGetter* GetSyncedWindowDelegatesGetter() = 0;
zeaf09345c2015-10-27 05:29:5052
blundelle95da1e2015-10-28 11:58:0453 // Returns a LocalSessionEventRouter instance that is customized for the
54 // embedder's context.
pnoland1901afa52017-03-23 21:24:0055 virtual LocalSessionEventRouter* GetLocalSessionEventRouter() = 0;
blundelle95da1e2015-10-28 11:58:0456
zeaf09345c2015-10-27 05:29:5057 // TODO(zea): add getters for the history and favicon services for the favicon
58 // cache to consume once it's componentized.
59
60 private:
61 DISALLOW_COPY_AND_ASSIGN(SyncSessionsClient);
62};
63
64} // namespace sync_sessions
65
66#endif // COMPONENTS_SYNC_SESSIONS_SYNC_SESSIONS_CLIENT_H_