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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2482853002: Suppress KeyUp events after PreHandleKeyboardEvent consumes RawKeyDown (Closed)
Patch Set: Created 4 years, 1 month 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/render_widget_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 2335a60fa9e27504129300f8935b3a8e6eef7961..0f1f6b9d5b1140b71aa5b4840c547ad85cc165ab 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1143,13 +1143,14 @@ void RenderWidgetHostImpl::ForwardKeyboardEvent(
return;
if (suppress_next_char_events_) {
- // If preceding RawKeyDown event was handled by the browser, then we need
- // suppress all Char events generated by it. Please note that, one
- // RawKeyDown event may generate multiple Char events, so we can't reset
- // |suppress_next_char_events_| until we get a KeyUp or a RawKeyDown.
- if (key_event.type == WebKeyboardEvent::Char)
+ // If the preceding RawKeyDown event was handled by the browser, then we
+ // need to suppress all events generated by it until the next RawKeyDown or
dtapuska 2016/11/07 16:00:44 The member variable name is slightly confusing now
Matt Giuca 2016/11/08 03:04:15 +1
+ // KeyDown event.
+ if (key_event.type == WebKeyboardEvent::KeyUp ||
+ key_event.type == WebKeyboardEvent::Char)
Matt Giuca 2016/11/08 03:04:15 So I thought about the case where you interleave t
return;
- // We get a KeyUp or a RawKeyDown event.
+ DCHECK(key_event.type == WebKeyboardEvent::RawKeyDown ||
+ key_event.type == WebKeyboardEvent::KeyDown);
suppress_next_char_events_ = false;
}
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698