summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/glue/synced_tab_delegate.h
blob: 087dfbe5b5e36859663f4b6cfc9c8e1c9288d7e2 (plain)
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
// Copyright (c) 2011 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__
#pragma once

#include <string>

#include "chrome/browser/sessions/session_id.h"

class Profile;

namespace content {
class NavigationEntry;
}

namespace browser_sync {

// A SyncedTabDelegate is used to insulate the sync code from depending
// directly on TabContents, TabContentsWrapper and NavigationController.
class SyncedTabDelegate {
 public:
  // Method from TabContentsWrapper.

  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 TabContentsWrapper.

  virtual bool HasExtensionAppId() const = 0;
  virtual const std::string& GetExtensionAppId() const = 0;

  // Method 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;

 protected:
  virtual ~SyncedTabDelegate() {}
};

}  // namespace browser_sync

#endif  // CHROME_BROWSER_SYNC_GLUE_SYNCED_TAB_DELEGATE_H__