| Index: chrome/browser/ui/cocoa/presentation_mode_controller.mm
|
| diff --git a/chrome/browser/ui/cocoa/presentation_mode_controller.mm b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
|
| index 8b118397a84f02767090d7c46840e1fd002b70f0..fa2876d34f91d650606c8cdec4af987376411e1e 100644
|
| --- a/chrome/browser/ui/cocoa/presentation_mode_controller.mm
|
| +++ b/chrome/browser/ui/cocoa/presentation_mode_controller.mm
|
| @@ -18,6 +18,7 @@ NSString* const kWillLeaveFullscreenNotification =
|
| @"WillLeaveFullscreenNotification";
|
|
|
| namespace {
|
| +
|
| // The activation zone for the main menu is 4 pixels high; if we make it any
|
| // smaller, then the menu can be made to appear without the bar sliding down.
|
| const CGFloat kDropdownActivationZoneHeight = 4;
|
| @@ -32,7 +33,20 @@ const NSTimeInterval kDropdownHideDelay = 0.2;
|
| // returns 0 when the menu bar is hidden.)
|
| const CGFloat kFloatingBarVerticalOffset = 22;
|
|
|
| -} // end namespace
|
| +OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
|
| + EventRef event,
|
| + void* context) {
|
| + PresentationModeController* self =
|
| + static_cast<PresentationModeController*>(context);
|
| + CGFloat reveal = 0;
|
| + GetEventParameter(event, FOUR_CHAR_CODE('rvlf'), typeCGFloat, NULL,
|
| + sizeof(CGFloat), NULL, &reveal);
|
| + if ([self inPresentationMode])
|
| + [self changeFloatingBarShownFraction:reveal];
|
| + return CallNextEventHandler(handler, event);
|
| +}
|
| +
|
| +} // namespace
|
|
|
|
|
| // Helper class to manage animations for the dropdown bar. Calls
|
| @@ -169,6 +183,11 @@ const CGFloat kFloatingBarVerticalOffset = 22;
|
| if ((self = [super init])) {
|
| browserController_ = controller;
|
| systemFullscreenMode_ = base::mac::kFullScreenModeNormal;
|
| +
|
| + EventTypeSpec eventSpec = { kEventClassMenu, 2004 };
|
| + InstallApplicationEventHandler(NewEventHandlerUPP(&MenuBarRevealHandler),
|
| + 1, &eventSpec,
|
| + self, &menuBarTrackingHandler_);
|
| }
|
|
|
| // Let the world know what we're up to.
|
| @@ -180,6 +199,9 @@ const CGFloat kFloatingBarVerticalOffset = 22;
|
| }
|
|
|
| - (void)dealloc {
|
| + RemoveEventHandler(menuBarTrackingHandler_);
|
| + menuBarTrackingHandler_ = NULL;
|
| +
|
| DCHECK(!inPresentationMode_);
|
| DCHECK(!trackingArea_);
|
| [super dealloc];
|
| @@ -455,6 +477,7 @@ const CGFloat kFloatingBarVerticalOffset = 22;
|
| if ([browserController_ floatingBarShownFraction] == fraction)
|
| return;
|
|
|
| +/*
|
| // Create the animation and set it up.
|
| currentAnimation_.reset(
|
| [[DropdownAnimation alloc] initWithFraction:fraction
|
| @@ -470,6 +493,7 @@ const CGFloat kFloatingBarVerticalOffset = 22;
|
| [self removeTrackingAreaIfNecessary];
|
|
|
| [currentAnimation_ startAnimation];
|
| + */
|
| }
|
|
|
| - (void)scheduleShowForMouse {
|
|
|