OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ |
7 | 7 |
8 #include "base/mac/scoped_block.h" | 8 #include "base/mac/scoped_block.h" |
9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "chrome/browser/ui/cocoa/base_bubble_controller.h" | 10 #include "chrome/browser/ui/cocoa/base_bubble_controller.h" |
11 #import "ui/base/cocoa/tracking_area.h" | 11 #import "ui/base/cocoa/tracking_area.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class WebContents; | 14 class WebContents; |
15 } | 15 } |
16 | 16 |
17 // The ZoomBubbleController is used to display the current page zoom percent | 17 // The ZoomBubbleController is used to display the current page zoom percent |
18 // when not at the user's default. It is opened by the ZoomDecoration in the | 18 // when not at the user's default. It is opened by the ZoomDecoration in the |
19 // location bar. | 19 // location bar. |
20 @interface ZoomBubbleController : BaseBubbleController { | 20 @interface ZoomBubbleController : BaseBubbleController { |
21 @private | 21 @private |
22 // The contents for which the zoom percent is being displayed. | 22 // The contents for which the zoom percent is being displayed. |
23 content::WebContents* contents_; | 23 content::WebContents* contents_; |
24 | 24 |
25 // Whether or not the bubble should automatically close itself after being | 25 // Whether or not the bubble should automatically close itself after being |
26 // opened. | 26 // opened. |
27 BOOL autoClose_; | 27 BOOL autoClose_; |
28 | 28 |
29 // A block that is run when the bubble is being closed. This allows any | 29 // A block that is run when the bubble is being closed. This allows any |
30 // weak references to be niled. | 30 // weak references to be niled. |
31 base::mac::ScopedBlock<void(^)(ZoomBubbleController*)> closeObserver_; | 31 base::mac::ScopedBlock<void(^)(ZoomBubbleController*)> closeObserver_; |
32 | 32 |
33 // The text field that displays the current zoom percentage. | 33 // The text field that displays the current zoom percentage. |
34 scoped_nsobject<NSTextField> zoomPercent_; | 34 base::scoped_nsobject<NSTextField> zoomPercent_; |
35 | 35 |
36 // Whether or not the mouse is over the bubble. | 36 // Whether or not the mouse is over the bubble. |
37 BOOL isMouseInside_; | 37 BOOL isMouseInside_; |
38 | 38 |
39 // Used to prevent the bubble from auto-closing while the mouse is inside it. | 39 // Used to prevent the bubble from auto-closing while the mouse is inside it. |
40 ui::ScopedCrTrackingArea trackingArea_; | 40 ui::ScopedCrTrackingArea trackingArea_; |
41 } | 41 } |
42 | 42 |
43 // Creates the bubble for a parent window but does not show it. | 43 // Creates the bubble for a parent window but does not show it. |
44 - (id)initWithParentWindow:(NSWindow*)parentWindow | 44 - (id)initWithParentWindow:(NSWindow*)parentWindow |
(...skipping 24 matching lines...) Expand all Loading... |
69 | 69 |
70 @end | 70 @end |
71 | 71 |
72 namespace chrome { | 72 namespace chrome { |
73 | 73 |
74 void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval); | 74 void SetZoomBubbleAutoCloseDelayForTesting(NSTimeInterval time_interval); |
75 | 75 |
76 } // namespace chrome | 76 } // namespace chrome |
77 | 77 |
78 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ | 78 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_ZOOM_BUBBLE_CONTROLLER_H_ |
OLD | NEW |