OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 // | 21 // |
22 /////////////////////////////////////////////////////////////////////////////// | 22 /////////////////////////////////////////////////////////////////////////////// |
23 class Tab : public TabRenderer, | 23 class Tab : public TabRenderer, |
24 public views::ContextMenuController { | 24 public views::ContextMenuController { |
25 public: | 25 public: |
26 static const std::string kTabClassName; | 26 static const std::string kTabClassName; |
27 | 27 |
28 explicit Tab(TabController* controller); | 28 explicit Tab(TabController* controller); |
29 virtual ~Tab(); | 29 virtual ~Tab(); |
30 | 30 |
31 // Used to set/check whether this Tab is being animated closed. | |
32 void set_closing(bool closing) { closing_ = closing; } | |
33 bool closing() const { return closing_; } | |
34 | |
35 // See description above field. | |
36 void set_dragging(bool dragging) { dragging_ = dragging; } | |
37 bool dragging() const { return dragging_; } | |
38 | |
39 // TabRenderer overrides: | 31 // TabRenderer overrides: |
40 virtual bool IsSelected() const; | 32 virtual bool IsSelected() const; |
41 | 33 |
42 private: | 34 private: |
43 // views::View overrides: | 35 // views::View overrides: |
44 virtual bool HasHitTestMask() const; | 36 virtual bool HasHitTestMask() const; |
45 virtual void GetHitTestMask(gfx::Path* mask) const; | 37 virtual void GetHitTestMask(gfx::Path* mask) const; |
46 virtual bool OnMousePressed(const views::MouseEvent& event); | 38 virtual bool OnMousePressed(const views::MouseEvent& event); |
47 virtual bool OnMouseDragged(const views::MouseEvent& event); | 39 virtual bool OnMouseDragged(const views::MouseEvent& event); |
48 virtual void OnMouseReleased(const views::MouseEvent& event, | 40 virtual void OnMouseReleased(const views::MouseEvent& event, |
49 bool canceled); | 41 bool canceled); |
50 virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); | 42 virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); |
51 virtual bool GetTooltipTextOrigin(const gfx::Point& p, gfx::Point* origin); | 43 virtual bool GetTooltipTextOrigin(const gfx::Point& p, gfx::Point* origin); |
52 virtual std::string GetClassName() const { return kTabClassName; } | 44 virtual std::string GetClassName() const { return kTabClassName; } |
53 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); | 45 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
54 | 46 |
55 // views::ContextMenuController overrides: | 47 // views::ContextMenuController overrides: |
56 virtual void ShowContextMenu(views::View* source, | 48 virtual void ShowContextMenu(views::View* source, |
57 const gfx::Point& p, | 49 const gfx::Point& p, |
58 bool is_mouse_gesture); | 50 bool is_mouse_gesture); |
59 | 51 |
60 // views::ButtonListener overrides: | 52 // views::ButtonListener overrides: |
61 virtual void ButtonPressed(views::Button* sender, const views::Event& event); | 53 virtual void ButtonPressed(views::Button* sender, const views::Event& event); |
62 | 54 |
63 // Creates a path that contains the clickable region of the tab's visual | 55 // Creates a path that contains the clickable region of the tab's visual |
64 // representation. Used by GetViewForPoint for hit-testing. | 56 // representation. Used by GetViewForPoint for hit-testing. |
65 void MakePathForTab(gfx::Path* path) const; | 57 void MakePathForTab(gfx::Path* path) const; |
66 | 58 |
67 // True if the tab is being animated closed. | |
68 bool closing_; | |
69 | |
70 // True if the tab is being dragged. | |
71 bool dragging_; | |
72 | |
73 DISALLOW_COPY_AND_ASSIGN(Tab); | 59 DISALLOW_COPY_AND_ASSIGN(Tab); |
74 }; | 60 }; |
75 | 61 |
76 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_H_ | 62 #endif // CHROME_BROWSER_VIEWS_TABS_TAB_H_ |
OLD | NEW |