OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 virtual void OnUpdateCompositorContent() = 0; | 86 virtual void OnUpdateCompositorContent() = 0; |
87 | 87 |
88 // This is called loading the page has completed. | 88 // This is called loading the page has completed. |
89 virtual void OnPageLoadComplete() = 0; | 89 virtual void OnPageLoadComplete() = 0; |
90 | 90 |
91 // This is called when the view is destroyed, so that the observer can | 91 // This is called when the view is destroyed, so that the observer can |
92 // perform any necessary clean-up. | 92 // perform any necessary clean-up. |
93 virtual void OnViewDestroyed() = 0; | 93 virtual void OnViewDestroyed() = 0; |
94 }; | 94 }; |
95 | 95 |
| 96 // Displays and controls touch editing elements such as selection handles. |
| 97 class TouchEditingClient { |
| 98 public: |
| 99 TouchEditingClient() {} |
| 100 |
| 101 // Tells the client to start showing touch editing handles. |
| 102 virtual void StartTouchEditing() = 0; |
| 103 |
| 104 // Notifies the client that touch editing is no longer needed. |
| 105 virtual void EndTouchEditing() = 0; |
| 106 |
| 107 // Notifies the client that the selection bounds need to be updated. |
| 108 virtual void OnSelectionOrCursorChanged(const gfx::Rect& anchor, |
| 109 const gfx::Rect& focus) = 0; |
| 110 |
| 111 // Notifies the client that the current text input type as changed. |
| 112 virtual void OnTextInputTypeChanged(ui::TextInputType type) = 0; |
| 113 |
| 114 // Notifies the client that an input event is about to be sent to the |
| 115 // renderer. Returns true if the client wants to stop event propagation. |
| 116 virtual bool HandleInputEvent(const ui::Event* event) = 0; |
| 117 |
| 118 // Notifies the client that a gesture event ack was received. |
| 119 virtual void GestureEventAck(int gesture_event_type) = 0; |
| 120 |
| 121 // This is called when the view is destroyed, so that the client can |
| 122 // perform any necessary clean-up. |
| 123 virtual void OnViewDestroyed() = 0; |
| 124 |
| 125 protected: |
| 126 virtual ~TouchEditingClient() {} |
| 127 }; |
| 128 |
96 void set_paint_observer(PaintObserver* observer) { | 129 void set_paint_observer(PaintObserver* observer) { |
97 paint_observer_ = observer; | 130 paint_observer_ = observer; |
98 } | 131 } |
99 | 132 |
| 133 void set_touch_editing_client(TouchEditingClient* client) { |
| 134 touch_editing_client_ = client; |
| 135 } |
| 136 |
100 // RenderWidgetHostView implementation. | 137 // RenderWidgetHostView implementation. |
101 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; | 138 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE; |
102 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; | 139 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; |
103 virtual void SetSize(const gfx::Size& size) OVERRIDE; | 140 virtual void SetSize(const gfx::Size& size) OVERRIDE; |
104 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; | 141 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE; |
105 virtual gfx::NativeView GetNativeView() const OVERRIDE; | 142 virtual gfx::NativeView GetNativeView() const OVERRIDE; |
106 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; | 143 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; |
107 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; | 144 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; |
108 virtual bool HasFocus() const OVERRIDE; | 145 virtual bool HasFocus() const OVERRIDE; |
109 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; | 146 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, | 209 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, |
173 int gpu_host_id) OVERRIDE; | 210 int gpu_host_id) OVERRIDE; |
174 virtual void AcceleratedSurfacePostSubBuffer( | 211 virtual void AcceleratedSurfacePostSubBuffer( |
175 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, | 212 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, |
176 int gpu_host_id) OVERRIDE; | 213 int gpu_host_id) OVERRIDE; |
177 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 214 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
178 virtual void AcceleratedSurfaceRelease() OVERRIDE; | 215 virtual void AcceleratedSurfaceRelease() OVERRIDE; |
179 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; | 216 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
180 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; | 217 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; |
181 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; | 218 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
| 219 virtual void GestureEventAck(int gesture_event_type) OVERRIDE; |
182 virtual void ProcessAckedTouchEvent( | 220 virtual void ProcessAckedTouchEvent( |
183 const WebKit::WebTouchEvent& touch, | 221 const WebKit::WebTouchEvent& touch, |
184 InputEventAckState ack_result) OVERRIDE; | 222 InputEventAckState ack_result) OVERRIDE; |
185 virtual void SetHasHorizontalScrollbar( | 223 virtual void SetHasHorizontalScrollbar( |
186 bool has_horizontal_scrollbar) OVERRIDE; | 224 bool has_horizontal_scrollbar) OVERRIDE; |
187 virtual void SetScrollOffsetPinning( | 225 virtual void SetScrollOffsetPinning( |
188 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; | 226 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; |
189 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 227 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
190 virtual void OnAccessibilityNotifications( | 228 virtual void OnAccessibilityNotifications( |
191 const std::vector<AccessibilityHostMsg_NotificationParams>& | 229 const std::vector<AccessibilityHostMsg_NotificationParams>& |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 PluginWindowMoves plugin_window_moves_; | 621 PluginWindowMoves plugin_window_moves_; |
584 #endif | 622 #endif |
585 | 623 |
586 base::TimeTicks last_draw_ended_; | 624 base::TimeTicks last_draw_ended_; |
587 | 625 |
588 gfx::NativeViewAccessible accessible_parent_; | 626 gfx::NativeViewAccessible accessible_parent_; |
589 | 627 |
590 // Subscriber that listens to frame presentation events. | 628 // Subscriber that listens to frame presentation events. |
591 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 629 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
592 | 630 |
| 631 TouchEditingClient* touch_editing_client_; |
| 632 |
593 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 633 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
594 }; | 634 }; |
595 | 635 |
596 } // namespace content | 636 } // namespace content |
597 | 637 |
598 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 638 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |