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

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

Issue 11308085: Enable fullscreen for apps windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_command_controller_unittest.cc » ('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 "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/defaults.h" 9 #include "chrome/browser/defaults.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui); 1095 command_updater_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, show_main_ui);
1096 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui); 1096 command_updater_.UpdateCommandEnabled(IDC_VIEW_PASSWORDS, show_main_ui);
1097 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui); 1097 command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui);
1098 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui); 1098 command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui);
1099 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC) 1099 #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC)
1100 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui); 1100 command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui);
1101 #endif 1101 #endif
1102 1102
1103 // Disable explicit fullscreen toggling when in metro snap mode. 1103 // Disable explicit fullscreen toggling when in metro snap mode.
1104 bool fullscreen_enabled = !browser_->is_type_panel() && 1104 bool fullscreen_enabled = !browser_->is_type_panel() &&
1105 !browser_->is_app() &&
1106 fullscreen_mode != FULLSCREEN_METRO_SNAP; 1105 fullscreen_mode != FULLSCREEN_METRO_SNAP;
1107 #if defined(OS_MACOSX) 1106 #if defined(OS_MACOSX)
1108 // The Mac implementation doesn't support switching to fullscreen while 1107 // The Mac implementation doesn't support switching to fullscreen while
1109 // a tab modal dialog is displayed. 1108 // a tab modal dialog is displayed.
1110 int tabIndex = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model()); 1109 int tabIndex = chrome::IndexOfFirstBlockedTab(browser_->tab_strip_model());
1111 bool has_blocked_tab = tabIndex != browser_->tab_strip_model()->count(); 1110 bool has_blocked_tab = tabIndex != browser_->tab_strip_model()->count();
1112 fullscreen_enabled &= !has_blocked_tab; 1111 fullscreen_enabled &= !has_blocked_tab;
1112 #else
scheib 2012/11/19 18:05:49 Document why there is different behavior on Mac.
sail 2012/11/19 18:07:30 I don't know why there's a difference actually :-(
1113 // App windows are not allowed to enter fullscreen except on Mac.
1114 fullscreen_enabled &= !browser_->is_app();
1113 #endif 1115 #endif
1114 1116
1115 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled); 1117 command_updater_.UpdateCommandEnabled(IDC_FULLSCREEN, fullscreen_enabled);
1116 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE, 1118 command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE,
1117 fullscreen_enabled); 1119 fullscreen_enabled);
1118 1120
1119 UpdateCommandsForBookmarkBar(); 1121 UpdateCommandsForBookmarkBar();
1120 UpdateCommandsForMultipleProfiles(); 1122 UpdateCommandsForMultipleProfiles();
1121 } 1123 }
1122 1124
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1184 1186
1185 BrowserWindow* BrowserCommandController::window() { 1187 BrowserWindow* BrowserCommandController::window() {
1186 return browser_->window(); 1188 return browser_->window();
1187 } 1189 }
1188 1190
1189 Profile* BrowserCommandController::profile() { 1191 Profile* BrowserCommandController::profile() {
1190 return browser_->profile(); 1192 return browser_->profile();
1191 } 1193 }
1192 1194
1193 } // namespace chrome 1195 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_command_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698