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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, | 207 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, |
171 int gpu_host_id) OVERRIDE; | 208 int gpu_host_id) OVERRIDE; |
172 virtual void AcceleratedSurfacePostSubBuffer( | 209 virtual void AcceleratedSurfacePostSubBuffer( |
173 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, | 210 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, |
174 int gpu_host_id) OVERRIDE; | 211 int gpu_host_id) OVERRIDE; |
175 virtual void AcceleratedSurfaceSuspend() OVERRIDE; | 212 virtual void AcceleratedSurfaceSuspend() OVERRIDE; |
176 virtual void AcceleratedSurfaceRelease() OVERRIDE; | 213 virtual void AcceleratedSurfaceRelease() OVERRIDE; |
177 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; | 214 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE; |
178 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; | 215 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) OVERRIDE; |
179 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; | 216 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE; |
| 217 virtual void GestureEventAck(int gesture_event_type) OVERRIDE; |
180 virtual void ProcessAckedTouchEvent( | 218 virtual void ProcessAckedTouchEvent( |
181 const WebKit::WebTouchEvent& touch, | 219 const WebKit::WebTouchEvent& touch, |
182 InputEventAckState ack_result) OVERRIDE; | 220 InputEventAckState ack_result) OVERRIDE; |
183 virtual void SetHasHorizontalScrollbar( | 221 virtual void SetHasHorizontalScrollbar( |
184 bool has_horizontal_scrollbar) OVERRIDE; | 222 bool has_horizontal_scrollbar) OVERRIDE; |
185 virtual void SetScrollOffsetPinning( | 223 virtual void SetScrollOffsetPinning( |
186 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; | 224 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; |
187 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; | 225 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE; |
188 virtual void OnAccessibilityNotifications( | 226 virtual void OnAccessibilityNotifications( |
189 const std::vector<AccessibilityHostMsg_NotificationParams>& | 227 const std::vector<AccessibilityHostMsg_NotificationParams>& |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 PluginWindowMoves plugin_window_moves_; | 619 PluginWindowMoves plugin_window_moves_; |
582 #endif | 620 #endif |
583 | 621 |
584 base::TimeTicks last_draw_ended_; | 622 base::TimeTicks last_draw_ended_; |
585 | 623 |
586 gfx::NativeViewAccessible accessible_parent_; | 624 gfx::NativeViewAccessible accessible_parent_; |
587 | 625 |
588 // Subscriber that listens to frame presentation events. | 626 // Subscriber that listens to frame presentation events. |
589 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 627 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
590 | 628 |
| 629 TouchEditingClient* touch_editing_client_; |
| 630 |
591 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); | 631 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura); |
592 }; | 632 }; |
593 | 633 |
594 } // namespace content | 634 } // namespace content |
595 | 635 |
596 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ | 636 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_AURA_H_ |
OLD | NEW |