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

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 #3 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..9962975b2a80e37052c3b6877a79244572cdee0e 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -2457,10 +2457,16 @@ void BrowserView::LoadAccelerators() {
DCHECK(focus_manager);
// Let's fill our own accelerator table.
+ const bool is_app_mode = chrome::IsRunningInForcedAppMode();
const std::vector<chrome::AcceleratorMapping> accelerator_list(
chrome::GetAcceleratorList());
for (std::vector<chrome::AcceleratorMapping>::const_iterator it =
accelerator_list.begin(); it != accelerator_list.end(); ++it) {
+ // In app mode, only allow accelerators of white listed commands to pass
+ // through.
+ if (is_app_mode && !chrome::IsCommandAllowedInAppMode(it->command_id))
+ continue;
+
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