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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a Compile Error Created 4 years, 9 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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 1f2b90d10882ec8ef992b51f60a845792d508c76..b381a45de4dc8e4929849f9d3fa2c854b441b542 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -363,6 +363,7 @@ WebContentsImpl::WebContentsImpl(BrowserContext* browser_context)
audio_stream_monitor_(this),
virtual_keyboard_requested_(false),
page_scale_factor_is_one_(true),
+ view_with_active_text_input_(nullptr),
loading_weak_factory_(this),
weak_factory_(this) {
frame_tree_.SetFrameRemoveListener(
@@ -2240,6 +2241,35 @@ void WebContentsImpl::SendScreenRects() {
browser_plugin_embedder_->DidSendScreenRects();
}
+TextInputState WebContentsImpl::GetTextInputState() {
+ if (GetOuterWebContents())
+ return GetOuterWebContents()->GetTextInputState();
+ return text_input_state_;
+}
+
+void WebContentsImpl::UpdateTextInputState(RenderWidgetHostViewBase* rwhv,
+ bool text_input_state_changed) {
+ // If there is an outer WebContents, let it process this update.
+ if (GetOuterWebContents())
+ GetOuterWebContents()->UpdateTextInputState(rwhv, text_input_state_changed);
Charlie Reis 2016/03/15 18:32:01 Does this need an early return, or do we need to a
EhsanK 2016/03/15 23:51:18 This too is definitely a bug. I messed this (and t
+ // If this RWHV has a text input type of NONE, then there is nothing to
Charlie Reis 2016/03/15 18:32:01 nit: Blank line before.
EhsanK 2016/03/15 23:51:18 Done.
+ // report to the tab RWHV.
+ if (view_with_active_text_input_ != rwhv &&
+ rwhv->text_input_state()->type == ui::TEXT_INPUT_TYPE_NONE)
+ return;
+
+ view_with_active_text_input_ =
+ (rwhv->text_input_state()->type != ui::TEXT_INPUT_TYPE_NONE) ? rwhv
+ : nullptr;
+ text_input_state_ = *rwhv->text_input_state();
+
+ // The top level RWHV should know about the change.
+ RenderWidgetHostViewBase* tab_rwhv =
+ static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView());
+ if (tab_rwhv)
+ tab_rwhv->UpdateInputMethodIfNecessary(text_input_state_changed);
+}
+
BrowserAccessibilityManager*
WebContentsImpl::GetRootBrowserAccessibilityManager() {
RenderFrameHostImpl* rfh = GetMainFrame();

Powered by Google App Engine
This is Rietveld 408576698