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

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

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/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 8eb96897ecc8dc2feca83d74474372a6cdcf1550..42e658bc936ba2de00cbd8ef8bb4d8c7d08af7be 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -21,6 +21,7 @@
#include "cc/output/compositor_frame.h"
#include "cc/surfaces/surface_id.h"
#include "content/browser/renderer_host/event_with_latency_info.h"
+#include "content/browser/renderer_host/text_input_manager.h"
#include "content/common/content_export.h"
#include "content/common/input/input_event_ack_state.h"
#include "content/public/browser/readback_types.h"
@@ -66,14 +67,17 @@ class BrowserAccessibilityManager;
class RenderWidgetHostViewBaseObserver;
class SyntheticGesture;
class SyntheticGestureTarget;
+class TextInputManager;
class WebCursor;
struct DidOverscrollParams;
struct NativeWebKeyboardEvent;
struct TextInputState;
// Basic implementation shared by concrete RenderWidgetHostView subclasses.
-class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
- public IPC::Listener {
+class CONTENT_EXPORT RenderWidgetHostViewBase
+ : public RenderWidgetHostView,
+ public IPC::Listener,
+ public TextInputManager::Observer {
public:
~RenderWidgetHostViewBase() override;
@@ -240,6 +244,9 @@ 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.
+ virtual void TextInputStateChanged(const TextInputState& text_input_state);
+
//----------------------------------------------------------------------------
// The following static methods are implemented by each platform.
@@ -265,9 +272,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;
@@ -379,12 +383,23 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
virtual bool IsChildFrameForTesting() const;
virtual cc::SurfaceId SurfaceIdForTesting() const;
+ // TextInputManager::Observer implementation.
+ void OnDestroyingTextInputManager(
+ TextInputManager* text_input_manager) override;
+
protected:
// Interface class only, do not construct.
RenderWidgetHostViewBase();
void NotifyObserversAboutShutdown();
+ // Returns a reference to the current instance of TextInputManager. If no
+ // no reference is found, this method tries to obtain one from the
+ // RenderWidgetHostDelegate. Returns nullptr if no reference exists or
+ // can be obtained. Unless not possible, this method should be used internally
+ // to obtain TextInputManager.
+ TextInputManager* GetTextInputManager();
+
// Whether this view is a popup and what kind of popup it is (select,
// autofill...).
blink::WebPopupType popup_type_;
@@ -412,7 +427,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_;
@@ -423,6 +437,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// renderer.
bool pinch_zoom_enabled_;
+ // A reference to current TextInputManager instance this RWHV is registered
+ // with.
+ TextInputManager* text_input_manager_;
+
private:
void FlushInput();

Powered by Google App Engine
This is Rietveld 408576698