Chromium Code Reviews| 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_VIEWS_TABS_TAB_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/views/tabs/tab_strip_types.h" | 8 #include "chrome/browser/ui/views/tabs/tab_strip_types.h" |
| 9 | 9 |
| 10 class Tab; | 10 class Tab; |
| 11 | 11 |
| 12 namespace gfx { | 12 namespace gfx { |
| 13 class Point; | 13 class Point; |
| 14 } | 14 } |
| 15 namespace ui { | 15 namespace ui { |
| 16 class ListSelectionModel; | 16 class ListSelectionModel; |
| 17 class LocatedEvent; | 17 class LocatedEvent; |
| 18 class MouseEvent; | 18 class MouseEvent; |
| 19 } | 19 } |
| 20 namespace views { | 20 namespace views { |
| 21 class View; | 21 class View; |
| 22 } | 22 } |
| 23 | 23 |
| 24 // Controller for tabs. | 24 // Controller for tabs. |
| 25 class TabController { | 25 class TabController { |
|
dmazzoni
2014/07/16 15:08:25
You will probably need to update tab_unittest.cc a
evy
2014/07/16 16:44:26
Done. Is it okay if they return 0 for now?
| |
| 26 public: | 26 public: |
| 27 virtual const ui::ListSelectionModel& GetSelectionModel() = 0; | 27 virtual const ui::ListSelectionModel& GetSelectionModel() = 0; |
| 28 | 28 |
| 29 // Returns true if multiple selection is supported. | 29 // Returns true if multiple selection is supported. |
| 30 virtual bool SupportsMultipleSelection() = 0; | 30 virtual bool SupportsMultipleSelection() = 0; |
| 31 | 31 |
| 32 // Selects the tab. | 32 // Selects the tab. |
| 33 virtual void SelectTab(Tab* tab) = 0; | 33 virtual void SelectTab(Tab* tab) = 0; |
| 34 | 34 |
| 35 // Extends the selection from the anchor to |tab|. | 35 // Extends the selection from the anchor to |tab|. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 const ui::MouseEvent& event) = 0; | 82 const ui::MouseEvent& event) = 0; |
| 83 | 83 |
| 84 // Returns true if |tab| needs to be painted. If false is returned the tab is | 84 // Returns true if |tab| needs to be painted. If false is returned the tab is |
| 85 // not painted. If true is returned the tab should be painted and |clip| is | 85 // not painted. If true is returned the tab should be painted and |clip| is |
| 86 // set to the clip (if |clip| is empty means no clip). | 86 // set to the clip (if |clip| is empty means no clip). |
| 87 virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) = 0; | 87 virtual bool ShouldPaintTab(const Tab* tab, gfx::Rect* clip) = 0; |
| 88 | 88 |
| 89 // Returns true if tabs painted in the rectangular light-bar style. | 89 // Returns true if tabs painted in the rectangular light-bar style. |
| 90 virtual bool IsImmersiveStyle() const = 0; | 90 virtual bool IsImmersiveStyle() const = 0; |
| 91 | 91 |
| 92 // Returns the index of the specified tab in the model coordinate system, or | |
| 93 // -1 if tab is closing or not valid. | |
| 94 virtual int GetModelIndexOfTab(const Tab* tab) const = 0; | |
| 95 | |
| 96 // Gets the number of Tabs in the tab strip. | |
| 97 virtual int tab_count() const = 0; | |
|
dmazzoni
2014/07/16 15:08:25
As a convention, we only use the lowercase_with_un
evy
2014/07/16 16:44:26
Done.
| |
| 98 | |
| 92 protected: | 99 protected: |
| 93 virtual ~TabController() {} | 100 virtual ~TabController() {} |
| 94 }; | 101 }; |
| 95 | 102 |
| 96 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ | 103 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ |
| OLD | NEW |