diff options
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 6 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 49af65b..bb10b06 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -458,6 +458,7 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host) text_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), can_compose_inline_(true), has_composition_text_(false), + accept_return_character_(false), last_output_surface_id_(0), pending_delegated_ack_count_(0), skipped_frames_(false), @@ -2166,7 +2167,8 @@ void RenderWidgetHostViewAura::InsertChar(char16 ch, int flags) { return; } - if (host_) { + // Ignore character messages for VKEY_RETURN sent on CTRL+M. crbug.com/315547 + if (host_ && (accept_return_character_ || ch != ui::VKEY_RETURN)) { double now = ui::EventTimeForNow().InSecondsF(); // Send a blink::WebInputEvent::Char event to |host_|. NativeWebKeyboardEvent webkit_event(ui::ET_KEY_PRESSED, @@ -2596,6 +2598,8 @@ void RenderWidgetHostViewAura::OnKeyEvent(ui::KeyEvent* event) { ui::EventTimeForNow().InSecondsF()); host_->ForwardKeyboardEvent(webkit_event); } else { + if (event->key_code() == ui::VKEY_RETURN) + accept_return_character_ = event->type() == ui::ET_KEY_PRESSED; NativeWebKeyboardEvent webkit_event(event); host_->ForwardKeyboardEvent(webkit_event); } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index ec94e3f..af1d972 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -613,6 +613,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAura // Indicates if there is onging composition text. bool has_composition_text_; + // Whether return characters should be passed on to the RenderWidgetHostImpl. + bool accept_return_character_; + // Current tooltip text. string16 tooltip_; |