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_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/timer.h" | 9 #include "base/timer.h" |
10 #include "ui/views/bubble/bubble_delegate.h" | 10 #include "ui/views/bubble/bubble_delegate.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // Stops the auto-close timer. | 45 // Stops the auto-close timer. |
46 void StopTimer(); | 46 void StopTimer(); |
47 | 47 |
48 // views::View method. | 48 // views::View method. |
49 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; | 49 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
50 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; | 50 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE; |
51 | 51 |
52 // views::ButtonListener method. | 52 // views::ButtonListener method. |
53 virtual void ButtonPressed(views::Button* sender, | 53 virtual void ButtonPressed(views::Button* sender, |
54 const views::Event& event) OVERRIDE; | 54 const ui::Event& event) OVERRIDE; |
55 | 55 |
56 // views::BubbleDelegateView method. | 56 // views::BubbleDelegateView method. |
57 virtual void Init() OVERRIDE; | 57 virtual void Init() OVERRIDE; |
58 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 58 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
59 virtual void WindowClosing() OVERRIDE; | 59 virtual void WindowClosing() OVERRIDE; |
60 | 60 |
61 // Singleton instance of the zoom bubble. The zoom bubble can only be shown on | 61 // Singleton instance of the zoom bubble. The zoom bubble can only be shown on |
62 // the active browser window, so there is no case in which it will be shown | 62 // the active browser window, so there is no case in which it will be shown |
63 // twice at the same time. | 63 // twice at the same time. |
64 static ZoomBubbleView* zoom_bubble_; | 64 static ZoomBubbleView* zoom_bubble_; |
65 | 65 |
66 // Timer used to close the bubble when |auto_close_| is true. | 66 // Timer used to close the bubble when |auto_close_| is true. |
67 base::OneShotTimer<ZoomBubbleView> timer_; | 67 base::OneShotTimer<ZoomBubbleView> timer_; |
68 | 68 |
69 // Label displaying the zoom percentage. | 69 // Label displaying the zoom percentage. |
70 views::Label* label_; | 70 views::Label* label_; |
71 | 71 |
72 // The TabContents for the page whose zoom has changed. | 72 // The TabContents for the page whose zoom has changed. |
73 TabContents* tab_contents_; | 73 TabContents* tab_contents_; |
74 | 74 |
75 // Whether the currently displayed bubble will automatically close. | 75 // Whether the currently displayed bubble will automatically close. |
76 bool auto_close_; | 76 bool auto_close_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(ZoomBubbleView); | 78 DISALLOW_COPY_AND_ASSIGN(ZoomBubbleView); |
79 }; | 79 }; |
80 | 80 |
81 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ | 81 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ |
OLD | NEW |