Upstream version 11.39.250.0
[platform/framework/web/crosswalk.git] / src / content / browser / renderer_host / render_widget_host_view_aura.h
index c418b50..93a31d8 100644 (file)
@@ -35,8 +35,6 @@
 #include "ui/wm/public/activation_change_observer.h"
 #include "ui/wm/public/activation_delegate.h"
 
-struct ViewHostMsg_TextInputState_Params;
-
 namespace aura {
 class WindowTracker;
 namespace client {
@@ -116,6 +114,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
     // Notifies the client that a gesture event ack was received.
     virtual void GestureEventAck(int gesture_event_type) = 0;
 
+    // Notifies the client that the fling has ended, so it can activate touch
+    // editing if needed.
+    virtual void DidStopFlinging() = 0;
+
     // This is called when the view is destroyed, so that the client can
     // perform any necessary clean-up.
     virtual void OnViewDestroyed() = 0;
@@ -131,10 +133,12 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   explicit RenderWidgetHostViewAura(RenderWidgetHost* host);
 
   // RenderWidgetHostView implementation.
+  virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
   virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
   virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
   virtual void SetSize(const gfx::Size& size) OVERRIDE;
   virtual void SetBounds(const gfx::Rect& rect) OVERRIDE;
+  virtual gfx::Vector2dF GetLastScrollOffset() const OVERRIDE;
   virtual gfx::NativeView GetNativeView() const OVERRIDE;
   virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
   virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
@@ -162,8 +166,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   virtual void Blur() OVERRIDE;
   virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE;
   virtual void SetIsLoading(bool is_loading) OVERRIDE;
-  virtual void TextInputStateChanged(
-      const ViewHostMsg_TextInputState_Params& params) OVERRIDE;
+  virtual void TextInputTypeChanged(ui::TextInputType type,
+                                    ui::TextInputMode input_mode,
+                                    bool can_compose_inline) OVERRIDE;
   virtual void ImeCancelComposition() OVERRIDE;
   virtual void ImeCompositionRangeChanged(
       const gfx::Range& range,
@@ -178,11 +183,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   virtual gfx::Size GetRequestedRendererSize() const OVERRIDE;
   virtual void SelectionBoundsChanged(
       const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE;
-  virtual void ScrollOffsetChanged() OVERRIDE;
   virtual void CopyFromCompositingSurface(
       const gfx::Rect& src_subrect,
       const gfx::Size& dst_size,
-      const base::Callback<void(bool, const SkBitmap&)>& callback,
+      CopyFromCompositingSurfaceCallback& callback,
       const SkColorType color_type) OVERRIDE;
   virtual void CopyFromCompositingSurfaceToVideoFrame(
       const gfx::Rect& src_subrect,
@@ -223,11 +227,14 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() OVERRIDE;
   virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible()
       OVERRIDE;
+  virtual void ShowDisambiguationPopup(const gfx::Rect& rect_pixels,
+                                       const SkBitmap& zoomed_bitmap) OVERRIDE;
   virtual bool LockMouse() OVERRIDE;
   virtual void UnlockMouse() OVERRIDE;
   virtual void OnSwapCompositorFrame(
       uint32 output_surface_id,
       scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
+  virtual void DidStopFlinging() OVERRIDE;
 
 #if defined(OS_WIN)
   virtual void SetParentNativeViewAccessible(
@@ -319,6 +326,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   virtual void OnHostMoved(const aura::WindowTreeHost* host,
                            const gfx::Point& new_origin) OVERRIDE;
 
+  void OnTextInputStateChanged(const ViewHostMsg_TextInputState_Params& params);
+
 #if defined(OS_WIN)
   // Sets the cutout rects from constrained windows. These are rectangles that
   // windowed NPAPI plugins shouldn't paint in. Overwrites any previous cutout
@@ -332,6 +341,14 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   void OnLegacyWindowDestroyed();
 #endif
 
+  void DisambiguationPopupRendered(bool success, const SkBitmap& result);
+
+  void HideDisambiguationPopup();
+
+  void ProcessDisambiguationGesture(ui::GestureEvent* event);
+
+  void ProcessDisambiguationMouse(ui::MouseEvent* event);
+
   // Method to indicate if this instance is shutting down or closing.
   // TODO(shrikant): Discuss around to see if it makes sense to add this method
   // as part of RenderWidgetHostView.
@@ -433,8 +450,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   virtual ui::Compositor* GetCompositor() const OVERRIDE;
   virtual ui::Layer* GetLayer() OVERRIDE;
   virtual RenderWidgetHostImpl* GetHost() OVERRIDE;
-  virtual void SchedulePaintInRect(
-      const gfx::Rect& damage_rect_in_dip) OVERRIDE;
   virtual bool IsVisible() OVERRIDE;
   virtual scoped_ptr<ResizeLock> CreateResizeLock(
       bool defer_compositor_lock) OVERRIDE;
@@ -544,7 +559,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
   gfx::Point unlocked_global_mouse_position_;
   // Last cursor position relative to screen. Used to compute movementX/Y.
   gfx::Point global_mouse_position_;
-  // In mouse locked mode, we syntheticaly move the mouse cursor to the center
+  // In mouse locked mode, we synthetically move the mouse cursor to the center
   // of the window when it reaches the window borders to avoid it going outside.
   // This flag is used to differentiate between these synthetic mouse move
   // events vs. normal mouse move events.
@@ -570,7 +585,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
 
   typedef std::map<HWND, WebPluginGeometry> PluginWindowMoves;
   // Contains information about each windowed plugin's clip and cutout rects (
-  // from the renderer). This is needed because when the transient windoiws
+  // from the renderer). This is needed because when the transient windows
   // over this view changes, we need this information in order to create a new
   // region for the HWND.
   PluginWindowMoves plugin_window_moves_;
@@ -598,6 +613,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
 
   scoped_ptr<OverscrollController> overscroll_controller_;
 
+  // The last scroll offset of the view.
+  gfx::Vector2dF last_scroll_offset_;
+
   gfx::Insets insets_;
 
   std::vector<ui::LatencyInfo> software_latency_info_;
@@ -606,6 +624,13 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
 
   base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
 
+  gfx::Rect disambiguation_target_rect_;
+
+  // The last scroll offset when we start to render the link disambiguation
+  // view, so we can ensure the window hasn't moved between copying from the
+  // compositing surface and showing the disambiguation popup.
+  gfx::Vector2dF disambiguation_scroll_offset_;
+
   DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
 };