| 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 0a5a08116b0b8f41b97d5a0d6fbb5b575f18ced3..8b2b521da13243bfcd8f2a435b2127e61d30fd63 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_base.h
|
| +++ b/content/browser/renderer_host/render_widget_host_view_base.h
|
| @@ -67,6 +67,7 @@ class BrowserAccessibilityManager;
|
| class RenderWidgetHostViewBaseObserver;
|
| class SyntheticGesture;
|
| class SyntheticGestureTarget;
|
| +class TextInputManager;
|
| class WebCursor;
|
| struct DidOverscrollParams;
|
| struct NativeWebKeyboardEvent;
|
| @@ -129,6 +130,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
| // changed since the last time.
|
| bool HasDisplayPropertyChanged(gfx::NativeView view);
|
|
|
| + // Called by the TextInputManager to notify the view about being removed from
|
| + // the list of registered views, i.e., TextInputManager is no longer tracking
|
| + // TextInputState from this view. The RWHV should reset |text_input_manager_|
|
| + // to nullptr.
|
| + void DidUnregisterFromTextInputManager(TextInputManager* text_input_manager);
|
| +
|
| base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr();
|
|
|
| //----------------------------------------------------------------------------
|
| @@ -243,6 +250,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
| cc::SurfaceId original_surface,
|
| gfx::Point* transformed_point);
|
|
|
| + // Updates the state of the input method attached to the view.
|
| + // TODO(ekaramad): This method will not stay virtual. It will be moved up top
|
| + // with the other non-virtual methods after TextInputState tracking is fixed
|
| + // on all platforms (https://crbug.com/578168).
|
| + virtual void TextInputStateChanged(const TextInputState& text_input_state);
|
| +
|
| //----------------------------------------------------------------------------
|
| // The following static methods are implemented by each platform.
|
|
|
| @@ -268,9 +281,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 TextInputState& params) = 0;
|
| -
|
| // Cancel the ongoing composition of the input method attached to the view.
|
| virtual void ImeCancelComposition() = 0;
|
|
|
| @@ -388,6 +398,18 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
|
|
| void NotifyObserversAboutShutdown();
|
|
|
| + // Returns a reference to the current instance of TextInputManager. The
|
| + // reference is obtained from RenderWidgetHostDelegate. The first time a non-
|
| + // null reference is obtained, its value is cached in |text_input_manager_|
|
| + // and this view is registered with it. The RWHV will unregister from the
|
| + // TextInputManager if it is destroyed or if the TextInputManager itself is
|
| + // destroyed. The unregistration of the RWHV from TextInputManager is
|
| + // necessary and must be done by explicitly calling
|
| + // TextInputManager::Unregister.
|
| + // It is safer to use this method rather than directly dereferencing
|
| + // |text_input_manager_|.
|
| + TextInputManager* GetTextInputManager();
|
| +
|
| // Whether this view is a popup and what kind of popup it is (select,
|
| // autofill...).
|
| blink::WebPopupType popup_type_;
|
| @@ -415,7 +437,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_;
|
|
|
| @@ -426,6 +447,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
|
| // renderer.
|
| bool pinch_zoom_enabled_;
|
|
|
| + // A reference to current TextInputManager instance this RWHV is registered
|
| + // with. This is initially nullptr until the first time the view calls
|
| + // GetTextInputManager(). It also becomes nullptr when TextInputManager is
|
| + // destroyed before the RWHV is destroyed.
|
| + TextInputManager* text_input_manager_;
|
| +
|
| private:
|
| void FlushInput();
|
|
|
|
|