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

Unified Diff: ui/aura/shared/compound_event_filter.cc

Issue 11094088: Revert 161386 - Ignore certain keys when hiding the cursor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/shared/compound_event_filter.cc
===================================================================
--- ui/aura/shared/compound_event_filter.cc (revision 161397)
+++ ui/aura/shared/compound_event_filter.cc (working copy)
@@ -4,7 +4,6 @@
#include "ui/aura/shared/compound_event_filter.h"
-#include "base/hash_tables.h"
#include "ui/aura/client/activation_client.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/drag_drop_client.h"
@@ -33,50 +32,6 @@
GetActiveWindow();
}
-bool ShouldHideCursorOnKeyEvent(const ui::KeyEvent& event) {
- // All alt and control key commands are ignored.
- if (event.IsAltDown() || event.IsControlDown())
- return false;
-
- static bool inited = false;
- static base::hash_set<int32> ignored_keys;
- if (!inited) {
- // Modifiers.
- ignored_keys.insert(ui::VKEY_SHIFT);
- ignored_keys.insert(ui::VKEY_CONTROL);
- ignored_keys.insert(ui::VKEY_MENU);
-
- // Search key == VKEY_LWIN.
- ignored_keys.insert(ui::VKEY_LWIN);
-
- // Function keys.
- for (int key = ui::VKEY_F1; key <= ui::VKEY_F24; ++key)
- ignored_keys.insert(key);
-
- // Media keys.
- for (int key = ui::VKEY_BROWSER_BACK; key <= ui::VKEY_MEDIA_LAUNCH_APP2;
- ++key) {
- ignored_keys.insert(key);
- }
- ignored_keys.insert(ui::VKEY_WLAN);
- ignored_keys.insert(ui::VKEY_BRIGHTNESS_DOWN);
- ignored_keys.insert(ui::VKEY_BRIGHTNESS_UP);
- ignored_keys.insert(ui::VKEY_KBD_BRIGHTNESS_DOWN);
- ignored_keys.insert(ui::VKEY_KBD_BRIGHTNESS_UP);
-
-#if defined(OS_POSIX)
- ignored_keys.insert(ui::VKEY_POWER);
-#endif
-
- inited = true;
- }
-
- if (ignored_keys.count(event.key_code()) > 0)
- return false;
-
- return true;
-}
-
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -209,11 +164,8 @@
// CompoundEventFilter, ui::EventHandler implementation:
ui::EventResult CompoundEventFilter::OnKeyEvent(ui::KeyEvent* event) {
- if (ShouldHideCursorOnKeyEvent(*event)) {
- SetCursorVisibilityOnEvent(
- static_cast<Window*>(event->target()), event, false);
- }
-
+ SetCursorVisibilityOnEvent(
+ static_cast<Window*>(event->target()), event, false);
return FilterKeyEvent(event);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698