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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 12389083: cros: Add app mode restrictions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lint fix Created 7 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
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index f440dfc461c470951f4362448db56c19bc93f606..fdbc82b9f3db5564db0eb4dbc212f6673a0127bd 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2461,6 +2461,13 @@ void BrowserView::LoadAccelerators() {
chrome::GetAcceleratorList());
for (std::vector<chrome::AcceleratorMapping>::const_iterator it =
accelerator_list.begin(); it != accelerator_list.end(); ++it) {
+#if defined(OS_CHROMEOS)
+ // Only allow accelerators of white listed commands to pass through.
+ static const bool is_app_mode = chrome::IsRunningInForcedAppMode();
+ if (is_app_mode && !chrome::IsCommandAllowedInAppMode(it->command_id))
+ continue;
+#endif
+
ui::Accelerator accelerator(it->keycode, it->modifiers);
accelerator_table_[accelerator] = it->command_id;

Powered by Google App Engine
This is Rietveld 408576698