OLD | NEW |
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 #import "base/mac/mac_util.h" | 10 #import "base/mac/mac_util.h" |
| 11 #include "chrome/browser/fullscreen.h" |
11 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 12 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
12 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
13 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 14 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
14 | 15 |
15 NSString* const kWillEnterFullscreenNotification = | 16 NSString* const kWillEnterFullscreenNotification = |
16 @"WillEnterFullscreenNotification"; | 17 @"WillEnterFullscreenNotification"; |
17 NSString* const kWillLeaveFullscreenNotification = | 18 NSString* const kWillLeaveFullscreenNotification = |
18 @"WillLeaveFullscreenNotification"; | 19 @"WillLeaveFullscreenNotification"; |
19 | 20 |
20 namespace { | 21 namespace { |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 415 |
415 @implementation PresentationModeController (PrivateMethods) | 416 @implementation PresentationModeController (PrivateMethods) |
416 | 417 |
417 - (BOOL)isWindowOnPrimaryScreen { | 418 - (BOOL)isWindowOnPrimaryScreen { |
418 NSScreen* screen = [[browserController_ window] screen]; | 419 NSScreen* screen = [[browserController_ window] screen]; |
419 NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; | 420 NSScreen* primaryScreen = [[NSScreen screens] objectAtIndex:0]; |
420 return (screen == primaryScreen); | 421 return (screen == primaryScreen); |
421 } | 422 } |
422 | 423 |
423 - (BOOL)shouldToggleMenuBar { | 424 - (BOOL)shouldToggleMenuBar { |
424 return base::mac::IsOSSnowLeopard() && | 425 return !chrome::mac::SupportsSystemFullscreen() && |
425 [self isWindowOnPrimaryScreen] && | 426 [self isWindowOnPrimaryScreen] && |
426 [[browserController_ window] isMainWindow]; | 427 [[browserController_ window] isMainWindow]; |
427 } | 428 } |
428 | 429 |
429 - (base::mac::FullScreenMode)desiredSystemFullscreenMode { | 430 - (base::mac::FullScreenMode)desiredSystemFullscreenMode { |
430 if ([browserController_ floatingBarShownFraction] >= 1.0) | 431 if ([browserController_ floatingBarShownFraction] >= 1.0) |
431 return base::mac::kFullScreenModeHideDock; | 432 return base::mac::kFullScreenModeHideDock; |
432 return base::mac::kFullScreenModeHideAll; | 433 return base::mac::kFullScreenModeHideAll; |
433 } | 434 } |
434 | 435 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 - (void)hideActiveWindowUI { | 646 - (void)hideActiveWindowUI { |
646 if (systemFullscreenMode_ != base::mac::kFullScreenModeNormal) { | 647 if (systemFullscreenMode_ != base::mac::kFullScreenModeNormal) { |
647 base::mac::ReleaseFullScreen(systemFullscreenMode_); | 648 base::mac::ReleaseFullScreen(systemFullscreenMode_); |
648 systemFullscreenMode_ = base::mac::kFullScreenModeNormal; | 649 systemFullscreenMode_ = base::mac::kFullScreenModeNormal; |
649 } | 650 } |
650 | 651 |
651 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 | 652 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 |
652 } | 653 } |
653 | 654 |
654 @end | 655 @end |
OLD | NEW |