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

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: Comments from rsesek. 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 ()
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).
26 - (void)changeToolbarFraction:(CGFloat)fraction;
27
28 // Callback for menu bar animations.
29 - (void)setMenuBarRevealProgress:(CGFloat)progress;
30 @end
31
32 namespace { 23 namespace {
33 24
34 // The activation zone for the main menu is 4 pixels high; if we make it any 25 // 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. 26 // smaller, then the menu can be made to appear without the bar sliding down.
36 const CGFloat kDropdownActivationZoneHeight = 4; 27 const CGFloat kDropdownActivationZoneHeight = 4;
37 const NSTimeInterval kDropdownAnimationDuration = 0.12; 28 const NSTimeInterval kDropdownAnimationDuration = 0.12;
38 const NSTimeInterval kMouseExitCheckDelay = 0.1; 29 const NSTimeInterval kMouseExitCheckDelay = 0.1;
39 // This show delay attempts to match the delay for the main menu. 30 // This show delay attempts to match the delay for the main menu.
40 const NSTimeInterval kDropdownShowDelay = 0.3; 31 const NSTimeInterval kDropdownShowDelay = 0.3;
41 const NSTimeInterval kDropdownHideDelay = 0.2; 32 const NSTimeInterval kDropdownHideDelay = 0.2;
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 [self updateMenuBarAndDockVisibility]; 742 [self updateMenuBarAndDockVisibility];
752 743
753 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 744 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956
754 } 745 }
755 746
756 - (BOOL)shouldShowMenubarInImmersiveFullscreen { 747 - (BOOL)shouldShowMenubarInImmersiveFullscreen {
757 return toolbarFraction_ >= 1.0; 748 return toolbarFraction_ >= 1.0;
758 } 749 }
759 750
760 @end 751 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698