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

Side by Side Diff: chrome/browser/ui/cocoa/presentation_mode_controller.mm

Issue 545643002: mac: Add basic layout unit test for fullscreen transition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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 (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 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" 5 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/mac/sdk_forward_declarations.h" 10 #include "base/mac/sdk_forward_declarations.h"
11 #import "base/mac/mac_util.h" 11 #import "base/mac/mac_util.h"
12 #include "chrome/browser/fullscreen.h" 12 #include "chrome/browser/fullscreen.h"
13 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 13 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
14 #import "chrome/browser/ui/cocoa/nsview_additions.h" 14 #import "chrome/browser/ui/cocoa/nsview_additions.h"
15 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
16 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h " 16 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h "
17 17
18 NSString* const kWillEnterFullscreenNotification = 18 NSString* const kWillEnterFullscreenNotification =
19 @"WillEnterFullscreenNotification"; 19 @"WillEnterFullscreenNotification";
20 NSString* const kWillLeaveFullscreenNotification = 20 NSString* const kWillLeaveFullscreenNotification =
21 @"WillLeaveFullscreenNotification"; 21 @"WillLeaveFullscreenNotification";
22 22
23 @interface PresentationModeController () 23 @interface PresentationModeController ()
24 // Sets a new current floating bar shown fraction. NOTE: This function has side 24 // Sets a new current floating bar shown fraction. NOTE: This function has side
25 // effects, such as modifying the system fullscreen mode (menu bar shown state). 25 // effects, such as modifying the system fullscreen mode (menu bar shown state).
26 - (void)changeToolbarFraction:(CGFloat)fraction; 26 - (void)changeToolbarFraction:(CGFloat)fraction;
27
28 // Callback for menu bar animations.
29 - (void)setMenuBarRevealProgress:(CGFloat)progress;
30 @end 27 @end
31 28
32 namespace { 29 namespace {
33 30
34 // The activation zone for the main menu is 4 pixels high; if we make it any 31 // The activation zone for the main menu is 4 pixels high; if we make it any
35 // smaller, then the menu can be made to appear without the bar sliding down. 32 // smaller, then the menu can be made to appear without the bar sliding down.
36 const CGFloat kDropdownActivationZoneHeight = 4; 33 const CGFloat kDropdownActivationZoneHeight = 4;
37 const NSTimeInterval kDropdownAnimationDuration = 0.12; 34 const NSTimeInterval kDropdownAnimationDuration = 0.12;
38 const NSTimeInterval kMouseExitCheckDelay = 0.1; 35 const NSTimeInterval kMouseExitCheckDelay = 0.1;
39 // This show delay attempts to match the delay for the main menu. 36 // This show delay attempts to match the delay for the main menu.
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 [self updateMenuBarAndDockVisibility]; 748 [self updateMenuBarAndDockVisibility];
752 749
753 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 750 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956
754 } 751 }
755 752
756 - (BOOL)shouldShowMenubarInImmersiveFullscreen { 753 - (BOOL)shouldShowMenubarInImmersiveFullscreen {
757 return toolbarFraction_ >= 1.0; 754 return toolbarFraction_ >= 1.0;
758 } 755 }
759 756
760 @end 757 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698