Index: content/browser/renderer_host/text_input_manager.cc |
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc |
index eed20121103d96cdaaec68cdcafea5ecacc241a6..474f0f6f8b7dfba9dc6eef1256413d552ef9c355 100644 |
--- a/content/browser/renderer_host/text_input_manager.cc |
+++ b/content/browser/renderer_host/text_input_manager.cc |
@@ -85,8 +85,16 @@ void TextInputManager::UpdateTextInputState( |
text_input_state_map_[view] = text_input_state; |
// |active_view_| is only updated when the state for |view| is not none. |
Charlie Reis
2016/07/21 23:48:18
Let's update this as well. Maybe that it "only ne
EhsanK
2016/07/25 21:09:57
Acknowledged.
|
- if (text_input_state.type != ui::TEXT_INPUT_TYPE_NONE) |
+ if (text_input_state.type != ui::TEXT_INPUT_TYPE_NONE && |
+ active_view_ != view) { |
+ // |view| will become the new |active_view_|, which means the IPC to reset |
+ // the TextInputState for |active_view_| has not arrived yet (and will be |
+ // ignored later). So we should reset the TextInputState for |active_view_| |
+ // manually. |
+ if (active_view_) |
+ UpdateTextInputState(active_view_, TextInputState()); |
Charlie Reis
2016/07/21 23:48:18
This has a small risk of becoming an infinite recu
EhsanK
2016/07/25 21:09:57
The only reason I used recursion like this was to
|
active_view_ = view; |
+ } |
// If the state for |active_view_| is none, then we no longer have an |
// |active_view_|. |
@@ -233,4 +241,4 @@ TextInputManager::CompositionRangeInfo::CompositionRangeInfo( |
TextInputManager::CompositionRangeInfo::~CompositionRangeInfo() {} |
-} // namespace content |
+} // namespace content |