OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/tabs/tab_strip_model.h" | 10 #include "chrome/browser/tabs/tab_strip_model.h" |
11 #include "chrome/browser/ui/tabs/hover_tab_selector.h" | 11 #include "chrome/browser/ui/tabs/hover_tab_selector.h" |
12 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" | 12 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" |
13 #include "content/common/notification_observer.h" | 13 #include "content/common/notification_observer.h" |
14 #include "content/common/notification_registrar.h" | 14 #include "content/common/notification_registrar.h" |
15 | 15 |
16 class BaseTab; | 16 class BaseTab; |
17 class BaseTabStrip; | 17 class BaseTabStrip; |
18 class Browser; | 18 class Browser; |
| 19 class TabStripSelectionModel; |
19 | 20 |
20 struct TabRendererData; | 21 struct TabRendererData; |
21 | 22 |
22 // An implementation of TabStripController that sources data from the | 23 // An implementation of TabStripController that sources data from the |
23 // TabContentsWrappers in a TabStripModel. | 24 // TabContentsWrappers in a TabStripModel. |
24 class BrowserTabStripController : public TabStripController, | 25 class BrowserTabStripController : public TabStripController, |
25 public TabStripModelObserver, | 26 public TabStripModelObserver, |
26 public NotificationObserver { | 27 public NotificationObserver { |
27 public: | 28 public: |
28 BrowserTabStripController(Browser* browser, TabStripModel* model); | 29 BrowserTabStripController(Browser* browser, TabStripModel* model); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual bool IsCompatibleWith(BaseTabStrip* other) const OVERRIDE; | 65 virtual bool IsCompatibleWith(BaseTabStrip* other) const OVERRIDE; |
65 virtual void CreateNewTab() OVERRIDE; | 66 virtual void CreateNewTab() OVERRIDE; |
66 virtual void ClickActiveTab(int index) OVERRIDE; | 67 virtual void ClickActiveTab(int index) OVERRIDE; |
67 | 68 |
68 // TabStripModelObserver implementation: | 69 // TabStripModelObserver implementation: |
69 virtual void TabInsertedAt(TabContentsWrapper* contents, | 70 virtual void TabInsertedAt(TabContentsWrapper* contents, |
70 int model_index, | 71 int model_index, |
71 bool active) OVERRIDE; | 72 bool active) OVERRIDE; |
72 virtual void TabDetachedAt(TabContentsWrapper* contents, | 73 virtual void TabDetachedAt(TabContentsWrapper* contents, |
73 int model_index) OVERRIDE; | 74 int model_index) OVERRIDE; |
74 virtual void ActiveTabChanged(TabContentsWrapper* old_contents, | 75 virtual void TabSelectionChanged( |
75 TabContentsWrapper* contents, | 76 const TabStripSelectionModel& old_model) OVERRIDE; |
76 int model_index, | |
77 bool user_gesture) OVERRIDE; | |
78 virtual void TabMoved(TabContentsWrapper* contents, | 77 virtual void TabMoved(TabContentsWrapper* contents, |
79 int from_model_index, | 78 int from_model_index, |
80 int to_model_index) OVERRIDE; | 79 int to_model_index) OVERRIDE; |
81 virtual void TabChangedAt(TabContentsWrapper* contents, | 80 virtual void TabChangedAt(TabContentsWrapper* contents, |
82 int model_index, | 81 int model_index, |
83 TabChangeType change_type) OVERRIDE; | 82 TabChangeType change_type) OVERRIDE; |
84 virtual void TabReplacedAt(TabStripModel* tab_strip_model, | 83 virtual void TabReplacedAt(TabStripModel* tab_strip_model, |
85 TabContentsWrapper* old_contents, | 84 TabContentsWrapper* old_contents, |
86 TabContentsWrapper* new_contents, | 85 TabContentsWrapper* new_contents, |
87 int model_index) OVERRIDE; | 86 int model_index) OVERRIDE; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 140 |
142 NotificationRegistrar notification_registrar_; | 141 NotificationRegistrar notification_registrar_; |
143 | 142 |
144 // Helper for performing tab selection as a result of dragging over a tab. | 143 // Helper for performing tab selection as a result of dragging over a tab. |
145 HoverTabSelector hover_tab_selector_; | 144 HoverTabSelector hover_tab_selector_; |
146 | 145 |
147 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); | 146 DISALLOW_COPY_AND_ASSIGN(BrowserTabStripController); |
148 }; | 147 }; |
149 | 148 |
150 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ | 149 #endif // CHROME_BROWSER_UI_VIEWS_TABS_BROWSER_TAB_STRIP_CONTROLLER_H_ |
OLD | NEW |