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_COCOA_PRESENTATION_MODE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ |
7 | 7 |
| 8 #include <Carbon/Carbon.h> |
8 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
9 | 10 |
10 #include "base/mac/mac_util.h" | 11 #include "base/mac/mac_util.h" |
11 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 12 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
12 | 13 |
13 @class BrowserWindowController; | 14 @class BrowserWindowController; |
14 @class DropdownAnimation; | 15 @class DropdownAnimation; |
15 | 16 |
16 // Provides a controller to manage presentation mode for a single browser | 17 // Provides a controller to manage presentation mode for a single browser |
17 // window. This class handles running animations, showing and hiding the | 18 // window. This class handles running animations, showing and hiding the |
(...skipping 26 matching lines...) Expand all Loading... |
44 // area is attached to |contentView_|, because when the dropdown is completely | 45 // area is attached to |contentView_|, because when the dropdown is completely |
45 // hidden, we still need to keep a 1px tall tracking area visible. Attaching | 46 // hidden, we still need to keep a 1px tall tracking area visible. Attaching |
46 // to the content view allows us to do this. |trackingArea_| can be nil if | 47 // to the content view allows us to do this. |trackingArea_| can be nil if |
47 // not in presentation mode or during animations. | 48 // not in presentation mode or during animations. |
48 scoped_nsobject<NSTrackingArea> trackingArea_; | 49 scoped_nsobject<NSTrackingArea> trackingArea_; |
49 | 50 |
50 // Pointer to the currently running animation. Is nil if no animation is | 51 // Pointer to the currently running animation. Is nil if no animation is |
51 // running. | 52 // running. |
52 scoped_nsobject<DropdownAnimation> currentAnimation_; | 53 scoped_nsobject<DropdownAnimation> currentAnimation_; |
53 | 54 |
| 55 // Carbon event handler that's used on 10.7+ to track the menu bar as it's |
| 56 // animating in and out. Used instead of currentAnimation_. |
| 57 EventHandlerRef menuBarTrackingHandler_; |
| 58 |
54 // Timers for scheduled showing/hiding of the bar (which are always done with | 59 // Timers for scheduled showing/hiding of the bar (which are always done with |
55 // animation). | 60 // animation). |
56 scoped_nsobject<NSTimer> showTimer_; | 61 scoped_nsobject<NSTimer> showTimer_; |
57 scoped_nsobject<NSTimer> hideTimer_; | 62 scoped_nsobject<NSTimer> hideTimer_; |
58 | 63 |
59 // Holds the current bounds of |trackingArea_|, even if |trackingArea_| is | 64 // Holds the current bounds of |trackingArea_|, even if |trackingArea_| is |
60 // currently nil. Used to restore the tracking area when an animation | 65 // currently nil. Used to restore the tracking area when an animation |
61 // completes. | 66 // completes. |
62 NSRect trackingAreaBounds_; | 67 NSRect trackingAreaBounds_; |
63 | 68 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // effects, such as modifying the system fullscreen mode (menu bar shown state). | 119 // effects, such as modifying the system fullscreen mode (menu bar shown state). |
115 - (void)changeFloatingBarShownFraction:(CGFloat)fraction; | 120 - (void)changeFloatingBarShownFraction:(CGFloat)fraction; |
116 | 121 |
117 @end | 122 @end |
118 | 123 |
119 // Notification posted when we're about to enter or leave fullscreen. | 124 // Notification posted when we're about to enter or leave fullscreen. |
120 extern NSString* const kWillEnterFullscreenNotification; | 125 extern NSString* const kWillEnterFullscreenNotification; |
121 extern NSString* const kWillLeaveFullscreenNotification; | 126 extern NSString* const kWillLeaveFullscreenNotification; |
122 | 127 |
123 #endif // CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ | 128 #endif // CHROME_BROWSER_UI_COCOA_PRESENTATION_MODE_CONTROLLER_H_ |
OLD | NEW |