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

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

Issue 1948343002: [reland] Browser Side Text Input State Tracking for OOPIF (Aura Only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing shuchen@ and kenrb@ comments Created 4 years, 7 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 3362cc1b63417be749ef6832eabd73c03b175083..98262726a59ea4dded72748272fdb0066f228256 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -65,6 +65,7 @@
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h"
+#include "content/browser/renderer_host/text_input_manager.h"
#include "content/browser/screen_orientation/screen_orientation_dispatcher_host_impl.h"
#include "content/browser/site_instance_impl.h"
#include "content/browser/wake_lock/wake_lock_service_context.h"
@@ -1414,6 +1415,13 @@ void WebContentsImpl::AttachToOuterWebContentsFrame(
static_cast<RenderWidgetHostViewChildFrame*>(
render_manager->GetRenderWidgetHostView())
->RegisterSurfaceNamespaceId();
+
+ // At this point, we should destroy the TextInputManager which will notify all
+ // the RWHV in this WebContents.
+ // TODO(ekaramad): Is this the right way to for IME handoff? Is it possible to
+ // have TextInputState (not none) before attaching? If so, we need to restore
+ // it (crbug.com/609846).
+ text_input_manager_.reset(nullptr);
EhsanK 2016/05/13 16:00:56 kenrb@: This will notify all the RWHV (if any) and
}
void WebContentsImpl::Stop() {
@@ -2364,6 +2372,16 @@ void WebContentsImpl::SendScreenRects() {
browser_plugin_embedder_->DidSendScreenRects();
}
+TextInputManager* WebContentsImpl::GetTextInputManager() {
+ if (GetOuterWebContents())
+ return GetOuterWebContents()->GetTextInputManager();
+
+ if (!text_input_manager_)
+ text_input_manager_.reset(new TextInputManager());
+
+ return text_input_manager_.get();
+}
+
BrowserAccessibilityManager*
WebContentsImpl::GetRootBrowserAccessibilityManager() {
RenderFrameHostImpl* rfh = GetMainFrame();

Powered by Google App Engine
This is Rietveld 408576698