1. Token CRCs are not handled correctly. This adds the corrected Whispernet binary...
[chromium-blink-merge.git] / chrome / browser / sync / open_tabs_ui_delegate.h
blob2c6194bdd10a55b643b7e1037380e9069ff01f63
1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_SYNC_OPEN_TABS_UI_DELEGATE_H_
6 #define CHROME_BROWSER_SYNC_OPEN_TABS_UI_DELEGATE_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/memory/ref_counted.h"
13 #include "base/memory/ref_counted_memory.h"
14 #include "chrome/browser/sync/glue/synced_session.h"
15 #include "components/sessions/session_id.h"
16 #include "components/sessions/session_types.h"
18 namespace browser_sync {
20 class OpenTabsUIDelegate {
21 public:
22 // If a valid favicon for the page at |url| is found, fills |favicon_png| with
23 // the png-encoded image and returns true. Else, returns false.
24 virtual bool GetSyncedFaviconForPageURL(
25 const std::string& pageurl,
26 scoped_refptr<base::RefCountedMemory>* favicon_png) const = 0;
28 // Builds a list of all foreign sessions. Caller does NOT own SyncedSession
29 // objects.
30 // Returns true if foreign sessions were found, false otherwise.
31 virtual bool GetAllForeignSessions(
32 std::vector<const SyncedSession*>* sessions) = 0;
34 // Looks up the foreign tab identified by |tab_id| and belonging to foreign
35 // session |tag|. Caller does NOT own the SessionTab object.
36 // Returns true if the foreign session and tab were found, false otherwise.
37 virtual bool GetForeignTab(const std::string& tag,
38 const SessionID::id_type tab_id,
39 const sessions::SessionTab** tab) = 0;
41 // Delete a foreign session and all its sync data.
42 virtual void DeleteForeignSession(const std::string& tag) = 0;
44 // Loads all windows for foreign session with session tag |tag|. Caller does
45 // NOT own SyncedSession objects.
46 // Returns true if the foreign session was found, false otherwise.
47 virtual bool GetForeignSession(
48 const std::string& tag,
49 std::vector<const sessions::SessionWindow*>* windows) = 0;
51 // Sets |*local| to point to the sessions sync representation of the
52 // local machine.
53 virtual bool GetLocalSession(const SyncedSession** local) = 0;
55 protected:
56 virtual ~OpenTabsUIDelegate();
59 } // namespace browser_sync
61 #endif // CHROME_BROWSER_SYNC_OPEN_TABS_UI_DELEGATE_H_