OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_TABS_TAB_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_TABS_TAB_H_ |
6 #define CHROME_BROWSER_VIEWS_TABS_TAB_H_ | 6 #define CHROME_BROWSER_VIEWS_TABS_TAB_H_ |
7 | 7 |
8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
9 #include "chrome/browser/views/tabs/tab_renderer.h" | 9 #include "chrome/browser/views/tabs/tab_renderer.h" |
10 #include "chrome/views/base_button.h" | 10 #include "chrome/views/base_button.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Potentially starts a drag for the specified Tab. | 62 // Potentially starts a drag for the specified Tab. |
63 virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event) = 0; | 63 virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event) = 0; |
64 | 64 |
65 // Continues dragging a Tab. | 65 // Continues dragging a Tab. |
66 virtual void ContinueDrag(const views::MouseEvent& event) = 0; | 66 virtual void ContinueDrag(const views::MouseEvent& event) = 0; |
67 | 67 |
68 // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way | 68 // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way |
69 // other than the user releasing the mouse. Returns whether the tab has been | 69 // other than the user releasing the mouse. Returns whether the tab has been |
70 // destroyed. | 70 // destroyed. |
71 virtual bool EndDrag(bool canceled) = 0; | 71 virtual bool EndDrag(bool canceled) = 0; |
| 72 |
| 73 // Returns true if only one tab exists. |
| 74 virtual bool ContainsExactlyOneTab() const = 0; |
72 }; | 75 }; |
73 | 76 |
74 explicit Tab(TabDelegate* delegate); | 77 explicit Tab(TabDelegate* delegate); |
75 virtual ~Tab(); | 78 virtual ~Tab(); |
76 | 79 |
77 // Access the delegate. | 80 // Access the delegate. |
78 TabDelegate* delegate() const { return delegate_; } | 81 TabDelegate* delegate() const { return delegate_; } |
79 | 82 |
80 // Used to set/check whether this Tab is being animated closed. | 83 // Used to set/check whether this Tab is being animated closed. |
81 void set_closing(bool closing) { closing_ = closing; } | 84 void set_closing(bool closing) { closing_ = closing; } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool closing_; | 129 bool closing_; |
127 | 130 |
128 // If non-null it means we're showing a menu for the tab. | 131 // If non-null it means we're showing a menu for the tab. |
129 ContextMenuController* menu_controller_; | 132 ContextMenuController* menu_controller_; |
130 | 133 |
131 DISALLOW_COPY_AND_ASSIGN(Tab); | 134 DISALLOW_COPY_AND_ASSIGN(Tab); |
132 }; | 135 }; |
133 | 136 |
134 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_H_ | 137 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_H_ |
135 | 138 |
OLD | NEW |