Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / glue / synced_window_delegate.h
blob07230a007a9d3f534fcfc10197de5456d63c6aef
1 // Copyright (c) 2012 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_GLUE_SYNCED_WINDOW_DELEGATE_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_
8 #include <set>
10 #include "chrome/browser/sessions/session_id.h"
12 namespace browser_sync {
14 class SyncedTabDelegate;
16 // A SyncedWindowDelegate is used to insulate the sync code from depending
17 // directly on Browser and BrowserList.
18 class SyncedWindowDelegate {
19 public:
20 // Methods originating from WindowList
22 // This method is to be used instead of using the BrowserList iterator.
23 static const std::set<SyncedWindowDelegate*> GetSyncedWindowDelegates();
25 // This method is to be used instead of using BrowserList::FindBrowserWithId()
26 static const SyncedWindowDelegate* FindSyncedWindowDelegateWithId(
27 SessionID::id_type id);
29 // Methods originating from Browser.
31 // Returns true iff this browser has a visible window representation
32 // associated with it. Sometimes, if a window is being created/removed the
33 // model object may exist without its UI counterpart.
34 virtual bool HasWindow() const = 0;
36 // see Browser::session_id
37 virtual SessionID::id_type GetSessionId() const = 0;
39 // see Browser::tab_count
40 virtual int GetTabCount() const = 0;
42 // see Browser::active_index
43 virtual int GetActiveIndex() const = 0;
45 // see Browser::is_app
46 virtual bool IsApp() const = 0;
48 // see Browser::is_type_tabbed
49 virtual bool IsTypeTabbed() const = 0;
51 // see Browser::is_type_popup
52 virtual bool IsTypePopup() const = 0;
54 // Methods derivated from Browser
56 // Returns true iff the provided tab is currently "pinned" in the tab strip.
57 virtual bool IsTabPinned(const SyncedTabDelegate* tab) const = 0;
59 // see TabStripModel::GetWebContentsAt
60 virtual SyncedTabDelegate* GetTabAt(int index) const = 0;
62 // Return the tab id for the tab at |index|.
63 virtual SessionID::id_type GetTabIdAt(int index) const = 0;
65 // Return true if we are currently restoring sessions asynchronously.
66 virtual bool IsSessionRestoreInProgress() const = 0;
68 protected:
69 virtual ~SyncedWindowDelegate() {}
72 } // namespace browser_sync
74 #endif // CHROME_BROWSER_SYNC_GLUE_SYNCED_WINDOW_DELEGATE_H_