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

Unified Diff: content/browser/renderer_host/input/web_input_event_builders_mac.mm

Issue 1374933002: Fix false negatives in system key events recognition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/web_input_event_builders_mac.mm
diff --git a/content/browser/renderer_host/input/web_input_event_builders_mac.mm b/content/browser/renderer_host/input/web_input_event_builders_mac.mm
index 5b454d06f14b11982e86a63c619900ea61dd4eef..00d34f875417545f5c7300265ea4ab6003dd67a5 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_mac.mm
+++ b/content/browser/renderer_host/input/web_input_event_builders_mac.mm
@@ -526,11 +526,18 @@ bool IsSystemKeyEvent(const blink::WebKeyboardEvent& event) {
// shouldn't be used by Blink to scroll the current page, because we want
// to get that key back for it to do history navigation. Hence, the
// corresponding situation on OS X is to set this for cmd key presses.
+
// cmd-b and and cmd-i are system wide key bindings that OS X doesn't
// handle for us, so the editor handles them.
- return event.modifiers & blink::WebInputEvent::MetaKey &&
- event.windowsKeyCode != ui::VKEY_B &&
- event.windowsKeyCode != ui::VKEY_I;
+ int modifiers = event.modifiers & blink::WebInputEvent::InputModifiers;
+ if (modifiers == blink::WebInputEvent::MetaKey &&
+ event.windowsKeyCode == ui::VKEY_B)
+ return false;
+ if (modifiers == blink::WebInputEvent::MetaKey &&
+ event.windowsKeyCode == ui::VKEY_I)
+ return false;
+
+ return event.modifiers & blink::WebInputEvent::MetaKey;
}
blink::WebMouseWheelEvent::Phase PhaseForNSEventPhase(
« no previous file with comments | « no previous file | content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698