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

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: 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..0b0c12d8c5f5a54eb60ce415cb52dc7377f6a79c 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"
@@ -72,8 +73,10 @@ 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 +243,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 +271,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;
@@ -385,6 +388,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
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 RWHD.
kenrb 2016/05/05 20:26:28 Expand RWHD to RenderWidgetHostDelegate. In this c
EhsanK 2016/05/06 18:23:43 Done.
+ // Returns nullptr if no reference exists or obtained.
+ TextInputManager* GetTextInputManager();
+
// Whether this view is a popup and what kind of popup it is (select,
// autofill...).
blink::WebPopupType popup_type_;
@@ -412,7 +420,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,9 +430,17 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// renderer.
bool pinch_zoom_enabled_;
+ // A reference to the TextInputManager belonging to the top-level
+ // RenderWidgetHostDelegte.
+ TextInputManager* text_input_manager_;
+
private:
void FlushInput();
+ // TextInputManager::Observer overrides.
+ void OnTextInputManagerDestroyed(
+ TextInputManager* text_input_manager) override;
kenrb 2016/05/05 20:26:28 Why is this public in the base class but private h
EhsanK 2016/05/06 18:23:43 Actually, no good reason. I noticed RenderWidgetHo
+
gfx::Rect current_display_area_;
uint32_t renderer_frame_number_;

Powered by Google App Engine
This is Rietveld 408576698