| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <numeric> | 8 #include <numeric> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2076 } | 2076 } |
| 2077 | 2077 |
| 2078 // Called to transition into or out of fullscreen mode. Only use System | 2078 // Called to transition into or out of fullscreen mode. Only use System |
| 2079 // Fullscreen mode if the system supports it and we aren't trying to go | 2079 // Fullscreen mode if the system supports it and we aren't trying to go |
| 2080 // fullscreen for the renderer-initiated use cases. | 2080 // fullscreen for the renderer-initiated use cases. |
| 2081 // Discussion: http://crbug.com/179181 and http:/crbug.com/351252 | 2081 // Discussion: http://crbug.com/179181 and http:/crbug.com/351252 |
| 2082 - (void)setFullscreen:(BOOL)fullscreen { | 2082 - (void)setFullscreen:(BOOL)fullscreen { |
| 2083 if (fullscreen == [self isFullscreen]) | 2083 if (fullscreen == [self isFullscreen]) |
| 2084 return; | 2084 return; |
| 2085 | 2085 |
| 2086 if (!chrome::IsCommandEnabled(browser_.get(), IDC_FULLSCREEN)) | |
| 2087 return; | |
| 2088 | |
| 2089 if (fullscreen) { | 2086 if (fullscreen) { |
| 2090 const BOOL shouldUseSystemFullscreen = | 2087 const BOOL shouldUseSystemFullscreen = |
| 2091 chrome::mac::SupportsSystemFullscreen() && !fullscreenWindow_ && | 2088 chrome::mac::SupportsSystemFullscreen() && !fullscreenWindow_ && |
| 2092 !browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending(); | 2089 !browser_->fullscreen_controller()->IsWindowFullscreenForTabOrPending(); |
| 2093 if (shouldUseSystemFullscreen) { | 2090 if (shouldUseSystemFullscreen) { |
| 2094 if (FramedBrowserWindow* framedBrowserWindow = | 2091 if (FramedBrowserWindow* framedBrowserWindow = |
| 2095 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { | 2092 base::mac::ObjCCast<FramedBrowserWindow>([self window])) { |
| 2096 [framedBrowserWindow toggleSystemFullScreen]; | 2093 [framedBrowserWindow toggleSystemFullScreen]; |
| 2097 } | 2094 } |
| 2098 } else { | 2095 } else { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 | 2305 |
| 2309 - (BOOL)supportsBookmarkBar { | 2306 - (BOOL)supportsBookmarkBar { |
| 2310 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2307 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2311 } | 2308 } |
| 2312 | 2309 |
| 2313 - (BOOL)isTabbedWindow { | 2310 - (BOOL)isTabbedWindow { |
| 2314 return browser_->is_type_tabbed(); | 2311 return browser_->is_type_tabbed(); |
| 2315 } | 2312 } |
| 2316 | 2313 |
| 2317 @end // @implementation BrowserWindowController(WindowType) | 2314 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |