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

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

Issue 1652483002: Browser Side Text Input State Tracking for OOPIF. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small Fixes. Created 4 years, 10 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 9a2e25bcc2b04abc937a4dd588c51b04d152236b..1bf508483d0b436701d1938505d44c96957722e7 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -39,7 +39,7 @@ class SkBitmap;
struct AccessibilityHostMsg_EventParams;
struct ViewHostMsg_SelectionBounds_Params;
-struct ViewHostMsg_TextInputState_Params;
+struct TextInputState;
namespace media {
class VideoFrame;
@@ -67,6 +67,7 @@ class SyntheticGestureTarget;
class WebCursor;
struct DidOverscrollParams;
struct NativeWebKeyboardEvent;
+struct TextInputState;
struct WebPluginGeometry;
// Basic implementation shared by concrete RenderWidgetHostView subclasses.
@@ -124,6 +125,15 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// changed since the last time.
bool HasDisplayPropertyChanged(gfx::NativeView view);
+ // The last updated value of text input state for this frame. This is in
+ // general
+ // different from that of |text_input_state_| as the current text input state
+ // could be
+ // obtained from a focused child frame.
+ const TextInputState* current_text_input_state() const {
+ return cached_text_input_state_;
+ }
+
base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr();
//----------------------------------------------------------------------------
@@ -231,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
+ // 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);
+
+ // Notifies the top level RenderWidgetHostView or the corresponding
+ // ui::InputMethod of a change in text input state in either this RWHV or one
+ // of the child frame's RWHV.
+ virtual void UpdateTextInputState();
+
//----------------------------------------------------------------------------
// The following static methods are implemented by each platform.
@@ -261,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;
@@ -434,7 +455,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_;
@@ -448,12 +468,23 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
private:
void FlushInput();
+ // Returns the current text input state from all text input elements in this
+ // view or one of the child frame views.
+ const TextInputState* FindCurrentTextInputState();
+
gfx::Rect current_display_area_;
uint32_t renderer_frame_number_;
base::OneShotTimer flush_input_timer_;
+ // The last reported input state from the RenderWidgetHost.
+ scoped_ptr<TextInputState> text_input_state_;
+
+ // The current cached value of input state which could be obtained from
+ // another RWHV.
+ const TextInputState* cached_text_input_state_;
+
base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);

Powered by Google App Engine
This is Rietveld 408576698