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

Unified Diff: ui/wm/core/accelerator_filter.cc

Issue 2147013003: Mark POWER key as system key so that it won't be passed to regular apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 5 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 | « ui/wm/core/accelerator_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/accelerator_filter.cc
diff --git a/ui/wm/core/accelerator_filter.cc b/ui/wm/core/accelerator_filter.cc
index 233dc5809f916965623089ba8b443500d850012f..03ea898737df0f39963032d3863a04f738ecb66c 100644
--- a/ui/wm/core/accelerator_filter.cc
+++ b/ui/wm/core/accelerator_filter.cc
@@ -13,30 +13,6 @@
#include "ui/wm/core/accelerator_delegate.h"
namespace wm {
-namespace {
-
-// Returns true if |key_code| is a key usually handled directly by the shell.
-bool IsSystemKey(ui::KeyboardCode key_code) {
-#if defined(OS_CHROMEOS)
- switch (key_code) {
- case ui::VKEY_MEDIA_LAUNCH_APP2: // Fullscreen button.
- case ui::VKEY_MEDIA_LAUNCH_APP1: // Overview button.
- case ui::VKEY_BRIGHTNESS_DOWN:
- case ui::VKEY_BRIGHTNESS_UP:
- case ui::VKEY_KBD_BRIGHTNESS_DOWN:
- case ui::VKEY_KBD_BRIGHTNESS_UP:
- case ui::VKEY_VOLUME_MUTE:
- case ui::VKEY_VOLUME_DOWN:
- case ui::VKEY_VOLUME_UP:
- return true;
- default:
- return false;
- }
-#endif // defined(OS_CHROMEOS)
- return false;
-}
-
-} // namespace
////////////////////////////////////////////////////////////////////////////////
// AcceleratorFilter, public:
@@ -66,11 +42,7 @@ void AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) {
ui::Accelerator accelerator(*event);
accelerator_history_->StoreCurrentAccelerator(accelerator);
- AcceleratorDelegate::KeyType key_type =
- IsSystemKey(event->key_code()) ? AcceleratorDelegate::KEY_TYPE_SYSTEM
- : AcceleratorDelegate::KEY_TYPE_OTHER;
-
- if (delegate_->ProcessAccelerator(*event, accelerator, key_type))
+ if (delegate_->ProcessAccelerator(*event, accelerator))
event->StopPropagation();
}
« no previous file with comments | « ui/wm/core/accelerator_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698