Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_base.h |
| diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h |
| index 1cace30a162137c4f2b016d0ba5892fbc13051db..0a8d4337dec0bc97a09aa3582702dbb070eee8aa 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_base.h |
| +++ b/content/browser/renderer_host/render_widget_host_view_base.h |
| @@ -41,7 +41,7 @@ class SkBitmap; |
| struct AccessibilityHostMsg_EventParams; |
| struct ViewHostMsg_SelectionBounds_Params; |
| -struct ViewHostMsg_TextInputState_Params; |
| +struct TextInputState; |
| namespace media { |
| class VideoFrame; |
| @@ -70,6 +70,7 @@ class SyntheticGestureTarget; |
| class WebCursor; |
| struct DidOverscrollParams; |
| struct NativeWebKeyboardEvent; |
| +struct TextInputState; |
| struct WebPluginGeometry; |
| // Basic implementation shared by concrete RenderWidgetHostView subclasses. |
| @@ -127,6 +128,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| // changed since the last time. |
| bool HasDisplayPropertyChanged(gfx::NativeView view); |
| + const TextInputState* text_input_state() const { |
|
Charlie Reis
2016/03/15 18:32:00
Let's include a comment to give context about when
EhsanK
2016/03/15 23:51:18
Done.
|
| + return text_input_state_.get(); |
| + } |
| + |
| base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr(); |
| //---------------------------------------------------------------------------- |
| @@ -236,6 +241,21 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| cc::SurfaceId original_surface, |
| gfx::Point* transformed_point); |
| + // This method is excusively called by the owner RenderWidgetHost to inform |
| + // the view about a change in the input state which originated in the |
| + // corresponding RenderWidget. This state is stored at the RWHV. |
| + // Also, this change does not necessarily reflect the current state of the |
| + // input since the text input could be due to a change in the focused |
|
Charlie Reis
2016/03/15 18:32:00
nit: Remove extra space.
EhsanK
2016/03/15 23:51:18
Done. Thanks!
|
| + // child-frame's (in OOPIF) or the out of process content managed by |
| + // BrowserPlugin. |
| + // TODO(ekaramad): Make this non-virtual if possible. |
| + virtual void TextInputStateChanged(const TextInputState& params); |
| + |
| + // This method is used by the WebContents owning this view to notify the view |
| + // of a text input change in the tab. This method should not be called on |
| + // RenderWidgetHostViewChildFrame. |
|
Charlie Reis
2016/03/15 18:32:00
I'm unclear on the last sentence. Would it be cle
EhsanK
2016/03/15 23:51:17
Yes. Revised. Thanks!
|
| + virtual void UpdateInputMethodIfNecessary(bool text_input_state_changed); |
| + |
| //---------------------------------------------------------------------------- |
| // The following static methods are implemented by each platform. |
| @@ -266,10 +286,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| // Indicates whether the page has finished loading. |
| virtual void SetIsLoading(bool is_loading) = 0; |
| - // Updates the state of the input method attached to the view. |
| - virtual void TextInputStateChanged( |
| - const ViewHostMsg_TextInputState_Params& params) = 0; |
| - |
| // Cancel the ongoing composition of the input method attached to the view. |
| virtual void ImeCancelComposition() = 0; |
| @@ -450,7 +466,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| // The current selection range relative to the start of the web page. |
| gfx::Range selection_range_; |
| - protected: |
| // The scale factor of the display the renderer is currently on. |
| float current_device_scale_factor_; |
| @@ -472,6 +487,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, |
| base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
| + // The last reported input state by the RenderWidget. |
| + scoped_ptr<TextInputState> text_input_state_; |
| + |
| base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |