Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: chrome/browser/ui/cocoa/fullscreen/fullscreen_menubar_tracker.mm

Issue 2505653003: [Mac[ FullscreenToolbarController Refactor (Closed)
Patch Set: nits Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_menubar_tracker.h" 5 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_menubar_tracker.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
11 #import "chrome/browser/ui/cocoa/fullscreen_toolbar_controller.h" 11 #import "chrome/browser/ui/cocoa/fullscreen/fullscreen_toolbar_controller.h"
12 #include "ui/base/cocoa/appkit_utils.h" 12 #include "ui/base/cocoa/appkit_utils.h"
13 13
14 namespace { 14 namespace {
15 15
16 // The event kind value for a undocumented menubar show/hide Carbon event. 16 // The event kind value for a undocumented menubar show/hide Carbon event.
17 const CGFloat kMenuBarRevealEventKind = 2004; 17 const CGFloat kMenuBarRevealEventKind = 2004;
18 18
19 OSStatus MenuBarRevealHandler(EventHandlerCallRef handler, 19 OSStatus MenuBarRevealHandler(EventHandlerCallRef handler,
20 EventRef event, 20 EventRef event,
21 void* context) { 21 void* context) {
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 state_ = FullscreenMenubarState::SHOWN; 131 state_ = FullscreenMenubarState::SHOWN;
132 else if (ui::IsCGFloatEqual(progress, 0.0)) 132 else if (ui::IsCGFloatEqual(progress, 0.0))
133 state_ = FullscreenMenubarState::HIDDEN; 133 state_ = FullscreenMenubarState::HIDDEN;
134 else if (progress < menubarFraction_) 134 else if (progress < menubarFraction_)
135 state_ = FullscreenMenubarState::HIDING; 135 state_ = FullscreenMenubarState::HIDING;
136 else if (progress > menubarFraction_) 136 else if (progress > menubarFraction_)
137 state_ = FullscreenMenubarState::SHOWING; 137 state_ = FullscreenMenubarState::SHOWING;
138 138
139 menubarFraction_ = progress; 139 menubarFraction_ = progress;
140 140
141 [owner_ updateToolbar]; 141 [owner_ updateToolbarLayout];
142 } 142 }
143 143
144 - (BOOL)isMouseOnScreen { 144 - (BOOL)isMouseOnScreen {
145 return NSMouseInRect([NSEvent mouseLocation], 145 return NSMouseInRect([NSEvent mouseLocation],
146 [[browserWindowController_ window] screen].frame, false); 146 [[browserWindowController_ window] screen].frame, false);
147 } 147 }
148 148
149 - (void)activeSpaceDidChange:(NSNotification*)notification { 149 - (void)activeSpaceDidChange:(NSNotification*)notification {
150 menubarFraction_ = 0.0; 150 menubarFraction_ = 0.0;
151 state_ = FullscreenMenubarState::HIDDEN; 151 state_ = FullscreenMenubarState::HIDDEN;
152 [owner_ updateToolbar]; 152 [owner_ updateToolbarLayout];
153 } 153 }
154 154
155 @end 155 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698