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..523fc138dc02957cdb67ae36997b72ca2f134fe4 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,17 @@ |
#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/text_input_state.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 +385,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 +712,35 @@ void RenderWidgetHostViewBase::TransformPointToLocalCoordSpace( |
*transformed_point = point; |
} |
+void RenderWidgetHostViewBase::TextInputStateChanged( |
+ const TextInputState& 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 |