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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 class BaseTab; | 9 class BaseTab; |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Point; | 12 class Point; |
13 } | 13 } |
14 namespace views { | 14 namespace views { |
15 class MouseEvent; | 15 class MouseEvent; |
16 } | 16 } |
17 | 17 |
18 // Controller for tabs. | 18 // Controller for tabs. |
19 class TabController { | 19 class TabController { |
20 public: | 20 public: |
21 // Selects the tab. | 21 // Selects the tab. |
22 virtual void SelectTab(BaseTab* tab) = 0; | 22 virtual void SelectTab(BaseTab* tab) = 0; |
23 | 23 |
24 // Extends the selection from the anchor to |tab|. | 24 // Extends the selection from the anchor to |tab|. |
25 virtual void ExtendSelectionTo(BaseTab* tab) = 0; | 25 virtual void ExtendSelectionTo(BaseTab* tab) = 0; |
26 | 26 |
27 // Toggles whether |tab| is selected. | 27 // Toggles whether |tab| is selected. |
28 virtual void ToggleSelected(BaseTab* tab) = 0; | 28 virtual void ToggleSelected(BaseTab* tab) = 0; |
29 | 29 |
30 // Adds the selection the anchor to |tab|. | 30 // Adds the selection from the anchor to |tab|. |
31 virtual void AddSelectionFromAnchorTo(BaseTab* tab) = 0; | 31 virtual void AddSelectionFromAnchorTo(BaseTab* tab) = 0; |
32 | 32 |
33 // Closes the tab. | 33 // Closes the tab. |
34 virtual void CloseTab(BaseTab* tab) = 0; | 34 virtual void CloseTab(BaseTab* tab) = 0; |
35 | 35 |
36 // Shows a context menu for the tab at the specified point in screen coords. | 36 // Shows a context menu for the tab at the specified point in screen coords. |
37 virtual void ShowContextMenuForTab(BaseTab* tab, const gfx::Point& p) = 0; | 37 virtual void ShowContextMenuForTab(BaseTab* tab, const gfx::Point& p) = 0; |
38 | 38 |
39 // Returns true if |tab| is the active tab. The active tab is the one whose | 39 // Returns true if |tab| is the active tab. The active tab is the one whose |
40 // content is shown in the browser. | 40 // content is shown in the browser. |
(...skipping 22 matching lines...) Expand all Loading... |
63 // Returns the tab that contains the specified coordinates, in terms of |tab|, | 63 // Returns the tab that contains the specified coordinates, in terms of |tab|, |
64 // or NULL if there is no tab that contains the specified point. | 64 // or NULL if there is no tab that contains the specified point. |
65 virtual BaseTab* GetTabAt(BaseTab* tab, | 65 virtual BaseTab* GetTabAt(BaseTab* tab, |
66 const gfx::Point& tab_in_tab_coordinates) = 0; | 66 const gfx::Point& tab_in_tab_coordinates) = 0; |
67 | 67 |
68 protected: | 68 protected: |
69 virtual ~TabController() {} | 69 virtual ~TabController() {} |
70 }; | 70 }; |
71 | 71 |
72 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ | 72 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_CONTROLLER_H_ |
OLD | NEW |