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

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 2698013004: Revert 3c7af99, but keep only IsReservedCommandOrKey change (Closed)
Patch Set: Resolve review comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/browser_command_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index b59372d2c58d305beef3ecd49f680e4c1cefacf8..be7339df18bbbe48ce7c5a76f629db6eb8d5909e 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -187,22 +187,11 @@ bool BrowserCommandController::IsReservedCommandOrKey(
}
#endif
- const bool is_tab_or_window_command =
- command_id == IDC_CLOSE_TAB ||
- command_id == IDC_CLOSE_WINDOW ||
- command_id == IDC_NEW_INCOGNITO_WINDOW ||
- command_id == IDC_NEW_TAB ||
- command_id == IDC_NEW_WINDOW ||
- command_id == IDC_RESTORE_TAB ||
- command_id == IDC_SELECT_NEXT_TAB ||
- command_id == IDC_SELECT_PREVIOUS_TAB;
if (window()->IsFullscreen()) {
// In fullscreen, all commands except for IDC_FULLSCREEN and IDC_EXIT should
- // be delivered to the web page. See https://goo.gl/4tJ32G.
- if (command_id == IDC_FULLSCREEN)
- return true;
- if (is_tab_or_window_command)
- return false;
+ // be delivered to the web page. See, intent to implement,
+ // https://goo.gl/4tJ32G.
+ return command_id == IDC_EXIT || command_id == IDC_FULLSCREEN;
}
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
@@ -214,7 +203,15 @@ bool BrowserCommandController::IsReservedCommandOrKey(
return false;
#endif
- return is_tab_or_window_command || command_id == IDC_EXIT;
+ return command_id == IDC_CLOSE_TAB ||
+ command_id == IDC_CLOSE_WINDOW ||
+ command_id == IDC_NEW_INCOGNITO_WINDOW ||
+ command_id == IDC_NEW_TAB ||
+ command_id == IDC_NEW_WINDOW ||
+ command_id == IDC_RESTORE_TAB ||
+ command_id == IDC_SELECT_NEXT_TAB ||
+ command_id == IDC_SELECT_PREVIOUS_TAB ||
+ command_id == IDC_EXIT;
}
void BrowserCommandController::SetBlockCommandExecution(bool block) {
@@ -1079,17 +1076,6 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode() {
command_updater_.UpdateCommandEnabled(IDC_TOGGLE_FULLSCREEN_TOOLBAR,
fullscreen_enabled);
- command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW,
- !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW, !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, !is_fullscreen);
- command_updater_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB,
- !is_fullscreen);
-
UpdateCommandsForBookmarkBar();
}
« no previous file with comments | « no previous file | chrome/browser/ui/browser_command_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698