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

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: Created 4 years, 11 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..ff5cb5a1d030e79a5488c2d02c8b34076c333066 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -62,6 +62,7 @@ class LatencyInfo;
namespace content {
class BrowserAccessibilityDelegate;
class BrowserAccessibilityManager;
+class RenderFrameHostImpl;
class SyntheticGesture;
class SyntheticGestureTarget;
class WebCursor;
@@ -69,6 +70,8 @@ struct DidOverscrollParams;
struct NativeWebKeyboardEvent;
struct WebPluginGeometry;
+using TextInputState = ViewHostMsg_TextInputState_Params;
+
// Basic implementation shared by concrete RenderWidgetHostView subclasses.
class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
public IPC::Listener {
@@ -124,6 +127,18 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// changed since the last time.
bool HasDisplayPropertyChanged(gfx::NativeView view);
+ // Notifies the top level page RWHVBase about a change in text input state in
kenrb 2016/02/01 20:12:43 It suffices to say RenderWidgetHostView instead of
EhsanK 2016/02/12 15:46:59 Done.
+ // RWHVBase corresponding to out of process content represented by
+ // BrowserPlugin.
+ // TODO(ekaramad): Remove this API when BrowserPlugin is removed.
+ void NotifyGuestTextInputStateChanged(RenderWidgetHostViewBase* guest_rwhv);
+
+ // The current cached text input state which might be different from
+ // text_input_state_ if the view is for a main frame.
+ const TextInputState* current_text_input_state() const {
+ return cached_text_input_state_;
+ }
+
base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr();
//----------------------------------------------------------------------------
@@ -231,6 +246,19 @@ 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.
kenrb 2016/02/01 20:12:43 These comments need to be expanded. It appears tha
EhsanK 2016/02/12 15:46:59 Done.
+ // TODO(ekaramad): Make this non-virtual if possible.
+ virtual void TextInputStateChanged(
+ const ViewHostMsg_TextInputState_Params& 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 NotifyTextInputStateChanged();
+
+ // Returns true if this RenderWidgetHostViewBase is for a main frame.
+ virtual bool ShouldObtainTextInputStateFromSubFrameViews() const;
+
//----------------------------------------------------------------------------
// The following static methods are implemented by each platform.
@@ -261,10 +289,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;
@@ -392,6 +416,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// Interface class only, do not construct.
RenderWidgetHostViewBase();
+ // The frame currently focused in the frame tree containing this.
+ RenderFrameHostImpl* GetFocusedFrame() const;
+
#if defined(OS_WIN)
// Shared implementation of MovePluginWindows for use by win and aura/wina.
static void MovePluginWindowsHelper(
@@ -434,7 +461,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 +474,22 @@ 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_;
+ scoped_ptr<TextInputState> text_input_state_;
+
+ const TextInputState* cached_text_input_state_;
+
+ const RenderWidgetHostViewBase* focused_guest_rwhv_;
+
base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase);

Powered by Google App Engine
This is Rietveld 408576698