OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/sync/glue/synced_window_delegate.h" | 9 #include "chrome/browser/sync/glue/synced_window_delegate.h" |
10 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // with Android's Tabs and Tab Model. | 30 // with Android's Tabs and Tab Model. |
31 class TabModel : public content::NotificationObserver { | 31 class TabModel : public content::NotificationObserver { |
32 public: | 32 public: |
33 virtual Profile* GetProfile() const; | 33 virtual Profile* GetProfile() const; |
34 virtual bool IsOffTheRecord() const; | 34 virtual bool IsOffTheRecord() const; |
35 virtual browser_sync::SyncedWindowDelegate* GetSyncedWindowDelegate() const; | 35 virtual browser_sync::SyncedWindowDelegate* GetSyncedWindowDelegate() const; |
36 virtual SessionID::id_type GetSessionId() const; | 36 virtual SessionID::id_type GetSessionId() const; |
37 | 37 |
38 virtual int GetTabCount() const = 0; | 38 virtual int GetTabCount() const = 0; |
39 virtual int GetActiveIndex() const = 0; | 39 virtual int GetActiveIndex() const = 0; |
| 40 virtual content::WebContents* GetActiveWebContents() const; |
40 virtual content::WebContents* GetWebContentsAt(int index) const = 0; | 41 virtual content::WebContents* GetWebContentsAt(int index) const = 0; |
41 // This will return NULL if the tab has not yet been initialized. | 42 // This will return NULL if the tab has not yet been initialized. |
42 virtual TabAndroid* GetTabAt(int index) const = 0; | 43 virtual TabAndroid* GetTabAt(int index) const = 0; |
43 | 44 |
44 virtual void SetActiveIndex(int index) = 0; | 45 virtual void SetActiveIndex(int index) = 0; |
45 virtual void CloseTabAt(int index) = 0; | 46 virtual void CloseTabAt(int index) = 0; |
46 | 47 |
47 // Used for restoring tabs from synced foreign sessions. | 48 // Used for restoring tabs from synced foreign sessions. |
48 virtual void CreateTab(content::WebContents* web_contents, | 49 virtual void CreateTab(content::WebContents* web_contents, |
49 int parent_tab_id) = 0; | 50 int parent_tab_id) = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // across sessions. | 86 // across sessions. |
86 SessionID session_id_; | 87 SessionID session_id_; |
87 | 88 |
88 // The Registrar used to register TabModel for notifications. | 89 // The Registrar used to register TabModel for notifications. |
89 content::NotificationRegistrar registrar_; | 90 content::NotificationRegistrar registrar_; |
90 | 91 |
91 DISALLOW_COPY_AND_ASSIGN(TabModel); | 92 DISALLOW_COPY_AND_ASSIGN(TabModel); |
92 }; | 93 }; |
93 | 94 |
94 #endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ | 95 #endif // CHROME_BROWSER_UI_ANDROID_TAB_MODEL_TAB_MODEL_H_ |
OLD | NEW |