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

Side by Side Diff: chrome/browser/ui/browser_command_controller.cc

Issue 253493005: [Mac] Allow fullscreen transitions while constrained windows are open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/browser_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); 1253 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui);
1254 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); 1254 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui);
1255 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); 1255 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui);
1256 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); 1256 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui);
1257 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) 1257 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC)
1258 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); 1258 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui);
1259 #endif 1259 #endif
1260 1260
1261 // Disable explicit fullscreen toggling when in metro snap mode. 1261 // Disable explicit fullscreen toggling when in metro snap mode.
1262 bool fullscreen_enabled = window_state != WINDOW_STATE_METRO_SNAP; 1262 bool fullscreen_enabled = window_state != WINDOW_STATE_METRO_SNAP;
1263 #if defined(OS_MACOSX) 1263 #if !defined(OS_MACOSX)
Avi (use Gerrit) 2014/04/26 00:01:28 This is wrong. This breaks kFullscreenAllowed for
Avi (use Gerrit) 2014/04/26 00:22:42 Sorry, I misread this; I'm wrong here. Though we
miu 2014/04/26 01:07:03 Yes, this looked wrong to me too. However, when I
Avi (use Gerrit) 2014/04/26 02:49:28 Weird. OK, then.
1264 // The Mac implementation doesn't support switching to fullscreen while
1265 // a tab modal dialog is displayed.
1266 int tab_index = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model());
Avi (use Gerrit) 2014/04/26 00:01:28 This was the only use of IndexOfFirstBlockedTab. R
miu 2014/04/26 01:07:03 Done.
1267 bool has_blocked_tab = tab_index != browser_->tab_strip_model()->count();
1268 fullscreen_enabled &= !has_blocked_tab;
1269 #else
1270 if (window_state == WINDOW_STATE_NOT_FULLSCREEN && 1264 if (window_state == WINDOW_STATE_NOT_FULLSCREEN &&
1271 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) { 1265 !profile()->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed)) {
1272 // Disable toggling into fullscreen mode if disallowed by pref. 1266 // Disable toggling into fullscreen mode if disallowed by pref.
1273 fullscreen_enabled = false; 1267 fullscreen_enabled = false;
1274 } 1268 }
1275 #endif 1269 #endif
1276 1270
1277 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); 1271 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled);
1278 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, 1272 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE,
1279 fullscreen_enabled); 1273 fullscreen_enabled);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 1361
1368 BrowserWindow* BrowserCommandController::window() { 1362 BrowserWindow* BrowserCommandController::window() {
1369 return browser_->window(); 1363 return browser_->window();
1370 } 1364 }
1371 1365
1372 Profile* BrowserCommandController::profile() { 1366 Profile* BrowserCommandController::profile() {
1373 return browser_->profile(); 1367 return browser_->profile();
1374 } 1368 }
1375 1369
1376 } // namespace chrome 1370 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698