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

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

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Comments and Fixing Compile Errors Created 4 years, 10 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/renderer_host/render_widget_host_view_base.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 780ced5af6016c192761f09227148b61bae5ff28..7d1938200fdfad7b07f680c26918955d9879a361 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -10,9 +10,16 @@
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
+#include "content/browser/renderer_host/render_view_host_delegate.h"
+#include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/common/content_switches_internal.h"
+#include "content/common/input_messages.h"
+#include "content/common/site_isolation_policy.h"
+#include "content/common/view_messages.h"
#include "content/public/browser/render_widget_host_view_frame_subscriber.h"
+#include "content/public/common/browser_plugin_guest_mode.h"
#include "ui/gfx/display.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
@@ -377,7 +384,10 @@ RenderWidgetHostViewBase::RenderWidgetHostViewBase()
current_display_rotation_(gfx::Display::ROTATE_0),
pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
renderer_frame_number_(0),
+ text_input_state_(new TextInputState),
+ cached_text_input_state_(text_input_state_.get()),
weak_factory_(this) {
+ text_input_state_->can_compose_inline = true;
}
RenderWidgetHostViewBase::~RenderWidgetHostViewBase() {
@@ -701,4 +711,35 @@ void RenderWidgetHostViewBase::TransformPointToLocalCoordSpace(
*transformed_point = point;
}
+void RenderWidgetHostViewBase::TextInputStateChanged(
+ const ViewHostMsg_TextInputState_Params& params) {
+#if defined(OS_ANDROID)
+ if (params.is_non_ime_change) {
+ // Sends an acknowledgement to the renderer of a processed IME event.
+ GetRenderWidgetHost()->Send(
+ new InputMsg_ImeEventAck(GetRenderWidgetHost()->GetRoutingID()));
+ }
+#endif
+ *text_input_state_ = params;
+ UpdateTextInputState();
+}
+
+const TextInputState* RenderWidgetHostViewBase::FindCurrentTextInputState() {
+ if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
+ return text_input_state_.get();
+
+ const TextInputState* state = text_input_state_.get();
+ RenderWidgetHostViewBase* focused_view =
+ RenderWidgetHostImpl::From(GetRenderWidgetHost())
+ ->delegate()
+ ->GetFocusedView();
+ if (focused_view && focused_view != this)
+ state = focused_view->FindCurrentTextInputState();
+ return state;
+}
+
+void RenderWidgetHostViewBase::UpdateTextInputState() {
+ cached_text_input_state_ = FindCurrentTextInputState();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698