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

Side by Side Diff: trunk/src/chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 252233003: Reapply 266653 "[Mac] Allow fullscreen transitions while constrai..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
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
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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698