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