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

Unified Diff: ash/wm/maximize_mode/maximize_mode_event_blocker.cc

Issue 251193005: Enabled volume buttons when TouchView is active (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Jon's comments from Patch Set 2 Created 6 years, 8 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: ash/wm/maximize_mode/maximize_mode_event_blocker.cc
diff --git a/ash/wm/maximize_mode/maximize_mode_event_blocker.cc b/ash/wm/maximize_mode/maximize_mode_event_blocker.cc
index e283149b6fe66755d368efea094e209f45419b0c..1f679fb468d4fef8a751021b3adf77c96dc8278f 100644
--- a/ash/wm/maximize_mode/maximize_mode_event_blocker.cc
+++ b/ash/wm/maximize_mode/maximize_mode_event_blocker.cc
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/events/event_targeter.h"
+#include "ui/events/keycodes/keyboard_codes_posix.h"
flackr 2014/04/29 21:43:54 This is only for posix OS's, include "ui/events/ke
bruthig 2014/04/30 14:04:45 Done.
namespace ash {
@@ -54,8 +55,23 @@ void BlockKeyboardAndTouchpadTargeter::SetDefaultTargeter(
ui::EventTarget* BlockKeyboardAndTouchpadTargeter::FindTargetForEvent(
ui::EventTarget* root,
ui::Event* event) {
- if (event->HasNativeEvent() && (event->IsMouseEvent() || event->IsKeyEvent()))
- return NULL;
+ if (event->HasNativeEvent()) {
+ if (event->IsMouseEvent())
+ return NULL;
+ if (event->IsKeyEvent()) {
+ // TODO(bruthig): This is a partial fix to issue 364584.
flackr 2014/04/29 21:43:54 nit: use a link to the issue, i.e. http://crbug.co
flackr 2014/04/29 21:49:24 Also, if you're planning on closing the main bug,
bruthig 2014/04/30 14:04:45 Done.
bruthig 2014/04/30 14:04:45 Done.
+ // This fix enables all volume up & down events including those
+ // originating from the keyboard. This needs to be fixed to only allow
+ // events originating from hard buttons and filtering out those coming
+ // from the keyboard but this requires some work to the Event system
+ // so that we can distinguish between the two events at this level.
+ ui::KeyEvent* keyEvent = static_cast<ui::KeyEvent*>(event);
flackr 2014/04/29 21:43:54 s/keyEvent/key_event i.e. unix_hacker_style names
bruthig 2014/04/30 14:04:45 Done.
+ if (keyEvent->key_code() != ui::VKEY_VOLUME_DOWN &&
+ keyEvent->key_code() != ui::VKEY_VOLUME_UP) {
+ return NULL;
+ }
+ }
+ }
return default_targeter_->FindTargetForEvent(root, event);
}

Powered by Google App Engine
This is Rietveld 408576698