Commit 9ec96ea3 authored by Ella Ge's avatar Ella Ge Committed by Commit Bot

set latency_info source_event_type on fake KeyUp

latency_info.source_event_type for fake KeyUp event
should be OTHER instead of KEYPRESS.

Bug: 772505
Change-Id: Ie43e31426e345f427f0eeb9863fbd0449c1c67dc
Reviewed-on: https://chromium-review.googlesource.com/727370Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Ella Ge <eirage@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510072}
parent 20998a13
...@@ -2325,12 +2325,15 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged( ...@@ -2325,12 +2325,15 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged(
NativeWebKeyboardEvent fakeEvent = event; NativeWebKeyboardEvent fakeEvent = event;
fakeEvent.SetType(blink::WebInputEvent::kKeyUp); fakeEvent.SetType(blink::WebInputEvent::kKeyUp);
fakeEvent.skip_in_browser = true; fakeEvent.skip_in_browser = true;
widgetHost->ForwardKeyboardEventWithLatencyInfo(fakeEvent, latency_info); ui::LatencyInfo fake_event_latency_info = latency_info;
fake_event_latency_info.set_source_event_type(ui::SourceEventType::OTHER);
widgetHost->ForwardKeyboardEventWithLatencyInfo(fakeEvent,
fake_event_latency_info);
// Not checking |renderWidgetHostView_->render_widget_host_| here because // Not checking |renderWidgetHostView_->render_widget_host_| here because
// a key event with |skip_in_browser| == true won't be handled by browser, // a key event with |skip_in_browser| == true won't be handled by browser,
// thus it won't destroy the widget. // thus it won't destroy the widget.
widgetHost->ForwardKeyboardEventWithCommands(event, latency_info, widgetHost->ForwardKeyboardEventWithCommands(event, fake_event_latency_info,
&editCommands_); &editCommands_);
// Calling ForwardKeyboardEventWithCommands() could have destroyed the // Calling ForwardKeyboardEventWithCommands() could have destroyed the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment