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/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 | 914 |
915 - (void)exitAppKitFullscreen { | 915 - (void)exitAppKitFullscreen { |
916 DCHECK(base::mac::IsOSLionOrLater()); | 916 DCHECK(base::mac::IsOSLionOrLater()); |
917 if (FramedBrowserWindow* framedBrowserWindow = | 917 if (FramedBrowserWindow* framedBrowserWindow = |
918 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { | 918 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { |
919 [framedBrowserWindow toggleSystemFullScreen]; | 919 [framedBrowserWindow toggleSystemFullScreen]; |
920 } | 920 } |
921 } | 921 } |
922 | 922 |
923 - (NSRect)fullscreenButtonFrame { | 923 - (NSRect)fullscreenButtonFrame { |
924 // NSWindowFullScreenButton is 10.7+ and results in log spam on 10.6 if used. | |
925 if (base::mac::IsOSSnowLeopard()) | |
926 return NSZeroRect; | |
927 | |
928 NSButton* fullscreenButton = | 924 NSButton* fullscreenButton = |
929 [[self window] standardWindowButton:NSWindowFullScreenButton]; | 925 [[self window] standardWindowButton:NSWindowFullScreenButton]; |
930 if (!fullscreenButton) | 926 if (!fullscreenButton) |
931 return NSZeroRect; | 927 return NSZeroRect; |
932 | 928 |
933 NSRect buttonFrame = [fullscreenButton frame]; | 929 NSRect buttonFrame = [fullscreenButton frame]; |
934 | 930 |
935 // When called from -windowWillExitFullScreen:, the button's frame may not | 931 // When called from -windowWillExitFullScreen:, the button's frame may not |
936 // be updated yet to match the new window size. | 932 // be updated yet to match the new window size. |
937 // We need to return where the button should be positioned. | 933 // We need to return where the button should be positioned. |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 return nil; | 1237 return nil; |
1242 } | 1238 } |
1243 | 1239 |
1244 - (BOOL)isFullscreenForTabContent { | 1240 - (BOOL)isFullscreenForTabContent { |
1245 return browser_->exclusive_access_manager() | 1241 return browser_->exclusive_access_manager() |
1246 ->fullscreen_controller() | 1242 ->fullscreen_controller() |
1247 ->IsWindowFullscreenForTabOrPending(); | 1243 ->IsWindowFullscreenForTabOrPending(); |
1248 } | 1244 } |
1249 | 1245 |
1250 @end // @implementation BrowserWindowController(Private) | 1246 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |