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

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: for comments in #1 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
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
sky 2013/03/04 22:25:14 Don't we want this when in ash mode too?
xiyuan 2013/03/04 22:38:32 Good point. Removed.
+ // Only allow accelerators of white listed commands to pass through.
+ static const bool is_app_mode = chrome::IsRunningInForcedAppMode();
sky 2013/03/04 22:25:14 Is there a compelling reason to make this static?
xiyuan 2013/03/04 22:38:32 Moved it outside the loop and removed "static".
+ if (is_app_mode && !chrome::IsCommandAllowedInAppMode(it->command_id))
+ continue;
+#endif
+
ui::Accelerator accelerator(it->keycode, it->modifiers);
accelerator_table_[accelerator] = it->command_id;
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698