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

Unified Diff: content/browser/renderer_host/text_input_manager.cc

Issue 2354793003: Browser Side TextInputState Tracking for Android (Closed)
Patch Set: Addressing kenrb@'s comments Created 4 years, 1 month 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
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 3b75d36aca95cf2e63c1f29109057b2f2b796ec4..868d9cd6c9a4d3fd2e85eecac40b5525f0db778b 100644
--- a/content/browser/renderer_host/text_input_manager.cc
+++ b/content/browser/renderer_host/text_input_manager.cc
@@ -25,8 +25,8 @@ bool AreDifferentTextInputStates(const content::TextInputState& old_state,
return old_state.type != new_state.type ||
old_state.can_compose_inline != new_state.can_compose_inline;
#else
- // TODO(ekaramad): Implement the logic for other platforms (crbug.com/578168).
- NOTREACHED();
+ // On Android, TextInputState update is sent only if there is some change in
+ // the state. So the new state is always different.
Charlie Reis 2016/11/02 22:23:13 nit: Comma, not period. (Second sentence is not a
EhsanK 2016/11/18 19:55:59 Acknowledged...and good point. I believe what need
return true;
#endif
}
@@ -57,8 +57,12 @@ RenderWidgetHostImpl* TextInputManager::GetActiveWidget() const {
: nullptr;
}
-const TextInputState* TextInputManager::GetTextInputState() const {
- return !!active_view_ ? &text_input_state_map_.at(active_view_) : nullptr;
+const TextInputState* TextInputManager::GetTextInputState(
+ RenderWidgetHostViewBase* view) const {
+ DCHECK(!view || IsRegistered(view));
+ if (!view)
+ view = active_view_;
+ return !!view ? &text_input_state_map_.at(view) : nullptr;
}
const TextInputManager::SelectionRegion* TextInputManager::GetSelectionRegion(

Powered by Google App Engine
This is Rietveld 408576698