| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "base/mac/mac_util.h" | 10 #import "base/mac/mac_util.h" |
| 10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 11 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 12 #include "chrome/common/chrome_switches.h" |
| 11 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 13 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
| 12 | 14 |
| 13 NSString* const kWillEnterFullscreenNotification = | 15 NSString* const kWillEnterFullscreenNotification = |
| 14 @"WillEnterFullscreenNotification"; | 16 @"WillEnterFullscreenNotification"; |
| 15 NSString* const kWillLeaveFullscreenNotification = | 17 NSString* const kWillLeaveFullscreenNotification = |
| 16 @"WillLeaveFullscreenNotification"; | 18 @"WillLeaveFullscreenNotification"; |
| 17 | 19 |
| 18 namespace { | 20 namespace { |
| 19 // The activation zone for the main menu is 4 pixels high; if we make it any | 21 // The activation zone for the main menu is 4 pixels high; if we make it any |
| 20 // smaller, then the menu can be made to appear without the bar sliding down. | 22 // smaller, then the menu can be made to appear without the bar sliding down. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 [browserController_ lockBarVisibilityForOwner:self | 280 [browserController_ lockBarVisibilityForOwner:self |
| 279 withAnimation:NO | 281 withAnimation:NO |
| 280 delay:NO]; | 282 delay:NO]; |
| 281 [self setupTrackingArea]; | 283 [self setupTrackingArea]; |
| 282 } | 284 } |
| 283 | 285 |
| 284 - (void)ensureOverlayShownWithAnimation:(BOOL)animate delay:(BOOL)delay { | 286 - (void)ensureOverlayShownWithAnimation:(BOOL)animate delay:(BOOL)delay { |
| 285 if (!inPresentationMode_) | 287 if (!inPresentationMode_) |
| 286 return; | 288 return; |
| 287 | 289 |
| 290 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 291 return; |
| 292 |
| 288 if (animate) { | 293 if (animate) { |
| 289 if (delay) { | 294 if (delay) { |
| 290 [self startShowTimer]; | 295 [self startShowTimer]; |
| 291 } else { | 296 } else { |
| 292 [self cancelAllTimers]; | 297 [self cancelAllTimers]; |
| 293 [self changeOverlayToFraction:1 withAnimation:YES]; | 298 [self changeOverlayToFraction:1 withAnimation:YES]; |
| 294 } | 299 } |
| 295 } else { | 300 } else { |
| 296 DCHECK(!delay); | 301 DCHECK(!delay); |
| 297 [self cancelAllTimers]; | 302 [self cancelAllTimers]; |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 - (void)hideActiveWindowUI { | 645 - (void)hideActiveWindowUI { |
| 641 if (systemFullscreenMode_ != base::mac::kFullScreenModeNormal) { | 646 if (systemFullscreenMode_ != base::mac::kFullScreenModeNormal) { |
| 642 base::mac::ReleaseFullScreen(systemFullscreenMode_); | 647 base::mac::ReleaseFullScreen(systemFullscreenMode_); |
| 643 systemFullscreenMode_ = base::mac::kFullScreenModeNormal; | 648 systemFullscreenMode_ = base::mac::kFullScreenModeNormal; |
| 644 } | 649 } |
| 645 | 650 |
| 646 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 | 651 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 |
| 647 } | 652 } |
| 648 | 653 |
| 649 @end | 654 @end |
| OLD | NEW |