diff options
author | shuchen <shuchen@chromium.org> | 2015-09-10 18:52:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-11 01:53:17 +0000 |
commit | f93c297af1ae9e4b2638de7c4b9ebb039c02ef9c (patch) | |
tree | b0852aa03ecb4924121508fe8d483c1e20282812 | |
parent | 24bb2db9bb159fd73d73244c75a34356d3ce7d03 (diff) | |
download | chromium_src-f93c297af1ae9e4b2638de7c4b9ebb039c02ef9c.zip chromium_src-f93c297af1ae9e4b2638de7c4b9ebb039c02ef9c.tar.gz chromium_src-f93c297af1ae9e4b2638de7c4b9ebb039c02ef9c.tar.bz2 |
BrowserPluginGuest should carry the correct text input states when notifying the text input type changed.
Especially for show_ime_if_needed value. Always passing false caused the bug.
BUG=528512
TEST=The bug not repro with this cl.
Review URL: https://codereview.chromium.org/1332753002
Cr-Commit-Position: refs/heads/master@{#348311}
-rw-r--r-- | content/browser/browser_plugin/browser_plugin_guest.cc | 17 | ||||
-rw-r--r-- | content/browser/browser_plugin/browser_plugin_guest.h | 6 |
2 files changed, 5 insertions, 18 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc index 7942c4f..167550d 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.cc +++ b/content/browser/browser_plugin/browser_plugin_guest.cc @@ -92,10 +92,6 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view, has_render_view_(has_render_view), is_in_destruction_(false), initialized_(false), - last_text_input_type_(ui::TEXT_INPUT_TYPE_NONE), - last_input_mode_(ui::TEXT_INPUT_MODE_DEFAULT), - last_input_flags_(0), - last_can_compose_inline_(true), guest_proxy_routing_id_(MSG_ROUTING_NONE), last_drag_status_(blink::WebDragStatusUnknown), seen_embedder_system_drag_ended_(false), @@ -574,12 +570,8 @@ void BrowserPluginGuest::SendTextInputTypeChangedToView( return; } - ViewHostMsg_TextInputState_Params params; - params.type = last_text_input_type_; - params.mode = last_input_mode_; - params.flags = last_input_flags_; - params.can_compose_inline = last_can_compose_inline_; - guest_rwhv->TextInputStateChanged(params); + if (last_text_input_state_.get()) + guest_rwhv->TextInputStateChanged(*last_text_input_state_); } void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( @@ -976,10 +968,7 @@ void BrowserPluginGuest::OnTakeFocus(bool reverse) { void BrowserPluginGuest::OnTextInputStateChanged( const ViewHostMsg_TextInputState_Params& params) { // Save the state of text input so we can restore it on focus. - last_text_input_type_ = params.type; - last_input_mode_ = params.mode; - last_input_flags_ = params.flags; - last_can_compose_inline_ = params.can_compose_inline; + last_text_input_state_.reset(new ViewHostMsg_TextInputState_Params(params)); SendTextInputTypeChangedToView( static_cast<RenderWidgetHostViewBase*>( diff --git a/content/browser/browser_plugin/browser_plugin_guest.h b/content/browser/browser_plugin/browser_plugin_guest.h index bb48799..cbe48f7 100644 --- a/content/browser/browser_plugin/browser_plugin_guest.h +++ b/content/browser/browser_plugin/browser_plugin_guest.h @@ -431,10 +431,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, bool initialized_; // Text input type states. - ui::TextInputType last_text_input_type_; - ui::TextInputMode last_input_mode_; - int last_input_flags_; - bool last_can_compose_inline_; + // Using scoped_ptr to avoid including the header file: view_messages.h. + scoped_ptr<const ViewHostMsg_TextInputState_Params> last_text_input_state_; // The is the routing ID for a swapped out RenderView for the guest // WebContents in the embedder's process. |