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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2644843004: Send keyboard-derived commands only if the key events are sent (Closed)
Patch Set: add TODO Created 3 years, 11 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 53c4808da4cf7e91f93a73f63774e097d2a1b58c..c91614f5c60f505661f68f3390315a215913abfc 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -2162,11 +2162,7 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged(
if (hasEditCommands_ && !hasMarkedText_)
delayEventUntilAfterImeCompostion = YES;
} else {
- if (!editCommands_.empty()) {
- widgetHost->Send(new InputMsg_SetEditCommandsForNextKeyEvent(
- widgetHost->GetRoutingID(), editCommands_));
- }
- widgetHost->ForwardKeyboardEvent(event);
+ widgetHost->ForwardKeyboardEventWithCommands(event, &editCommands_);
}
// Calling ForwardKeyboardEvent() could have destroyed the widget. When the
@@ -2235,11 +2231,7 @@ void RenderWidgetHostViewMac::OnDisplayMetricsChanged(
// a key event with |skip_in_browser| == true won't be handled by browser,
// thus it won't destroy the widget.
- if (!editCommands_.empty()) {
- widgetHost->Send(new InputMsg_SetEditCommandsForNextKeyEvent(
- widgetHost->GetRoutingID(), editCommands_));
- }
- widgetHost->ForwardKeyboardEvent(event);
+ widgetHost->ForwardKeyboardEventWithCommands(event, &editCommands_);
// Calling ForwardKeyboardEvent() could have destroyed the widget. When the
// widget was destroyed, |renderWidgetHostView_->render_widget_host_| will
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698