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 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Path; | 12 class Path; |
13 class Point; | 13 class Point; |
14 } | 14 } |
15 class TabContents; | 15 class BrowserExtender; |
16 class Profile; | |
17 | 16 |
18 /////////////////////////////////////////////////////////////////////////////// | 17 /////////////////////////////////////////////////////////////////////////////// |
19 // | 18 // |
20 // Tab | 19 // Tab |
21 // | 20 // |
22 // A subclass of TabRenderer that represents an individual Tab in a TabStrip. | 21 // A subclass of TabRenderer that represents an individual Tab in a TabStrip. |
23 // | 22 // |
24 /////////////////////////////////////////////////////////////////////////////// | 23 /////////////////////////////////////////////////////////////////////////////// |
25 class Tab : public TabRenderer, | 24 class Tab : public TabRenderer, |
26 public views::ContextMenuController { | 25 public views::ContextMenuController { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 virtual bool IsSelected() const; | 88 virtual bool IsSelected() const; |
90 | 89 |
91 private: | 90 private: |
92 // views::View overrides: | 91 // views::View overrides: |
93 virtual bool HasHitTestMask() const; | 92 virtual bool HasHitTestMask() const; |
94 virtual void GetHitTestMask(gfx::Path* mask) const; | 93 virtual void GetHitTestMask(gfx::Path* mask) const; |
95 virtual bool OnMousePressed(const views::MouseEvent& event); | 94 virtual bool OnMousePressed(const views::MouseEvent& event); |
96 virtual bool OnMouseDragged(const views::MouseEvent& event); | 95 virtual bool OnMouseDragged(const views::MouseEvent& event); |
97 virtual void OnMouseReleased(const views::MouseEvent& event, | 96 virtual void OnMouseReleased(const views::MouseEvent& event, |
98 bool canceled); | 97 bool canceled); |
| 98 virtual void OnMouseEntered(const views::MouseEvent& event); |
| 99 virtual void OnMouseMoved(const views::MouseEvent& event); |
| 100 virtual void OnMouseExited(const views::MouseEvent& event); |
99 virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); | 101 virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); |
100 virtual bool GetTooltipTextOrigin(int x, int y, gfx::Point* origin); | 102 virtual bool GetTooltipTextOrigin(int x, int y, gfx::Point* origin); |
101 virtual std::string GetClassName() const { return kTabClassName; } | 103 virtual std::string GetClassName() const { return kTabClassName; } |
102 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); | 104 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
103 virtual bool GetAccessibleName(std::wstring* name); | 105 virtual bool GetAccessibleName(std::wstring* name); |
104 | 106 |
105 // views::ContextMenuController overrides: | 107 // views::ContextMenuController overrides: |
106 virtual void ShowContextMenu(views::View* source, | 108 virtual void ShowContextMenu(views::View* source, |
107 int x, | 109 int x, |
108 int y, | 110 int y, |
109 bool is_mouse_gesture); | 111 bool is_mouse_gesture); |
110 | 112 |
111 // views::ButtonListener overrides: | 113 // views::ButtonListener overrides: |
112 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 114 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
113 | 115 |
| 116 // Returns the BrowserExtender of the window that this tab belongs to. |
| 117 BrowserExtender* GetBrowserExtender(); |
| 118 |
114 // Creates a path that contains the clickable region of the tab's visual | 119 // Creates a path that contains the clickable region of the tab's visual |
115 // representation. Used by GetViewForPoint for hit-testing. | 120 // representation. Used by GetViewForPoint for hit-testing. |
116 void MakePathForTab(gfx::Path* path) const; | 121 void MakePathForTab(gfx::Path* path) const; |
117 | 122 |
118 // An instance of a delegate object that can perform various actions based on | 123 // An instance of a delegate object that can perform various actions based on |
119 // user gestures. | 124 // user gestures. |
120 TabDelegate* delegate_; | 125 TabDelegate* delegate_; |
121 | 126 |
122 // True if the tab is being animated closed. | 127 // True if the tab is being animated closed. |
123 bool closing_; | 128 bool closing_; |
124 | 129 |
125 // If non-null it means we're showing a menu for the tab. | 130 // If non-null it means we're showing a menu for the tab. |
126 class TabContextMenuContents; | 131 class TabContextMenuContents; |
127 scoped_ptr<TabContextMenuContents> context_menu_contents_; | 132 scoped_ptr<TabContextMenuContents> context_menu_contents_; |
128 | 133 |
129 DISALLOW_COPY_AND_ASSIGN(Tab); | 134 DISALLOW_COPY_AND_ASSIGN(Tab); |
130 }; | 135 }; |
131 | 136 |
132 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_H_ | 137 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_H_ |
OLD | NEW |