1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__
#define CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__
#include <string>
#include <vector>
#include "components/sessions/session_id.h"
class Profile;
namespace content {
class NavigationEntry;
class WebContents;
}
namespace browser_sync {
// A SyncedTabDelegate is used to insulate the sync code from depending
// directly on WebContents, NavigationController, and the extensions TabHelper.
class SyncedTabDelegate {
public:
virtual ~SyncedTabDelegate() {}
// Methods from TabContents.
virtual SessionID::id_type GetWindowId() const = 0;
virtual SessionID::id_type GetSessionId() const = 0;
virtual bool IsBeingDestroyed() const = 0;
virtual Profile* profile() const = 0;
// Method derived from extensions TabHelper.
virtual std::string GetExtensionAppId() const = 0;
// Methods from NavigationController.
virtual int GetCurrentEntryIndex() const = 0;
virtual int GetEntryCount() const = 0;
virtual int GetPendingEntryIndex() const = 0;
virtual content::NavigationEntry* GetPendingEntry() const = 0;
virtual content::NavigationEntry* GetEntryAtIndex(int i) const = 0;
virtual content::NavigationEntry* GetActiveEntry() const = 0;
// Supervised user related methods.
virtual bool ProfileIsSupervised() const = 0;
virtual const std::vector<const content::NavigationEntry*>*
GetBlockedNavigations() const = 0;
virtual bool IsPinned() const = 0;
virtual bool HasWebContents() const = 0;
virtual content::WebContents* GetWebContents() const = 0;
// Session sync related methods.
virtual int GetSyncId() const = 0;
virtual void SetSyncId(int sync_id) = 0;
// Returns the SyncedTabDelegate associated with WebContents.
static SyncedTabDelegate* ImplFromWebContents(
content::WebContents* web_contents);
};
} // namespace browser_sync
#endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__
|