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_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ | 5 #ifndef CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ |
6 #define CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ | 6 #define CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 struct AccessibilityHostMsg_EventParams; | 27 struct AccessibilityHostMsg_EventParams; |
28 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 28 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
29 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 29 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
30 struct ViewHostMsg_TextInputState_Params; | 30 struct ViewHostMsg_TextInputState_Params; |
31 struct ViewHostMsg_SelectionBounds_Params; | 31 struct ViewHostMsg_SelectionBounds_Params; |
32 | 32 |
33 namespace media { | 33 namespace media { |
34 class VideoFrame; | 34 class VideoFrame; |
35 } | 35 } |
36 | 36 |
37 namespace WebKit { | 37 namespace blink { |
38 struct WebScreenInfo; | 38 struct WebScreenInfo; |
39 } | 39 } |
40 | 40 |
41 namespace content { | 41 namespace content { |
42 class BackingStore; | 42 class BackingStore; |
43 class RenderWidgetHostViewFrameSubscriber; | 43 class RenderWidgetHostViewFrameSubscriber; |
44 class SyntheticGesture; | 44 class SyntheticGesture; |
45 struct WebPluginGeometry; | 45 struct WebPluginGeometry; |
46 struct NativeWebKeyboardEvent; | 46 struct NativeWebKeyboardEvent; |
47 | 47 |
48 // This is the larger RenderWidgetHostView interface exposed only | 48 // This is the larger RenderWidgetHostView interface exposed only |
49 // within content/ and to embedders looking to port to new platforms. | 49 // within content/ and to embedders looking to port to new platforms. |
50 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 50 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
51 class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView, | 51 class CONTENT_EXPORT RenderWidgetHostViewPort : public RenderWidgetHostView, |
52 public IPC::Listener { | 52 public IPC::Listener { |
53 public: | 53 public: |
54 virtual ~RenderWidgetHostViewPort() {} | 54 virtual ~RenderWidgetHostViewPort() {} |
55 | 55 |
56 // Does the cast for you. | 56 // Does the cast for you. |
57 static RenderWidgetHostViewPort* FromRWHV(RenderWidgetHostView* rwhv); | 57 static RenderWidgetHostViewPort* FromRWHV(RenderWidgetHostView* rwhv); |
58 | 58 |
59 // Like RenderWidgetHostView::CreateViewForWidget, with cast. | 59 // Like RenderWidgetHostView::CreateViewForWidget, with cast. |
60 static RenderWidgetHostViewPort* CreateViewForWidget( | 60 static RenderWidgetHostViewPort* CreateViewForWidget( |
61 RenderWidgetHost* widget); | 61 RenderWidgetHost* widget); |
62 | 62 |
63 static void GetDefaultScreenInfo(WebKit::WebScreenInfo* results); | 63 static void GetDefaultScreenInfo(blink::WebScreenInfo* results); |
64 | 64 |
65 // Perform all the initialization steps necessary for this object to represent | 65 // Perform all the initialization steps necessary for this object to represent |
66 // a popup (such as a <select> dropdown), then shows the popup at |pos|. | 66 // a popup (such as a <select> dropdown), then shows the popup at |pos|. |
67 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, | 67 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, |
68 const gfx::Rect& pos) = 0; | 68 const gfx::Rect& pos) = 0; |
69 | 69 |
70 // Perform all the initialization steps necessary for this object to represent | 70 // Perform all the initialization steps necessary for this object to represent |
71 // a full screen window. | 71 // a full screen window. |
72 // |reference_host_view| is the view associated with the creating page that | 72 // |reference_host_view| is the view associated with the creating page that |
73 // helps to position the full screen widget on the correct monitor. | 73 // helps to position the full screen widget on the correct monitor. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 // Return true if the view has an accelerated surface that contains the last | 235 // Return true if the view has an accelerated surface that contains the last |
236 // presented frame for the view. If |desired_size| is non-empty, true is | 236 // presented frame for the view. If |desired_size| is non-empty, true is |
237 // returned only if the accelerated surface size matches. | 237 // returned only if the accelerated surface size matches. |
238 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) = 0; | 238 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) = 0; |
239 | 239 |
240 virtual void OnSwapCompositorFrame( | 240 virtual void OnSwapCompositorFrame( |
241 uint32 output_surface_id, | 241 uint32 output_surface_id, |
242 scoped_ptr<cc::CompositorFrame> frame) = 0; | 242 scoped_ptr<cc::CompositorFrame> frame) = 0; |
243 | 243 |
244 virtual void GetScreenInfo(WebKit::WebScreenInfo* results) = 0; | 244 virtual void GetScreenInfo(blink::WebScreenInfo* results) = 0; |
245 | 245 |
246 // The size of the view's backing surface in non-DPI-adjusted pixels. | 246 // The size of the view's backing surface in non-DPI-adjusted pixels. |
247 virtual gfx::Size GetPhysicalBackingSize() const = 0; | 247 virtual gfx::Size GetPhysicalBackingSize() const = 0; |
248 | 248 |
249 // The height of the physical backing surface that is overdrawn opaquely in | 249 // The height of the physical backing surface that is overdrawn opaquely in |
250 // the browser, for example by an on-screen-keyboard (in DPI-adjusted pixels). | 250 // the browser, for example by an on-screen-keyboard (in DPI-adjusted pixels). |
251 virtual float GetOverdrawBottomHeight() const = 0; | 251 virtual float GetOverdrawBottomHeight() const = 0; |
252 | 252 |
253 // Gets the bounds of the window, in screen coordinates. | 253 // Gets the bounds of the window, in screen coordinates. |
254 virtual gfx::Rect GetBoundsInRootWindow() = 0; | 254 virtual gfx::Rect GetBoundsInRootWindow() = 0; |
(...skipping 20 matching lines...) Expand all Loading... |
275 // Asks the view to create a synthetic gesture that will be used to | 275 // Asks the view to create a synthetic gesture that will be used to |
276 // simulate a user-initiated pinch-to-zoom. | 276 // simulate a user-initiated pinch-to-zoom. |
277 virtual SyntheticGesture* CreatePinchGesture( | 277 virtual SyntheticGesture* CreatePinchGesture( |
278 bool zoom_in, int pixels_to_move, int anchor_x, int anchor_y) = 0; | 278 bool zoom_in, int pixels_to_move, int anchor_x, int anchor_y) = 0; |
279 | 279 |
280 virtual void SetHasHorizontalScrollbar(bool has_horizontal_scrollbar) = 0; | 280 virtual void SetHasHorizontalScrollbar(bool has_horizontal_scrollbar) = 0; |
281 virtual void SetScrollOffsetPinning( | 281 virtual void SetScrollOffsetPinning( |
282 bool is_pinned_to_left, bool is_pinned_to_right) = 0; | 282 bool is_pinned_to_left, bool is_pinned_to_right) = 0; |
283 | 283 |
284 // Called when a mousewheel event was not processed by the renderer. | 284 // Called when a mousewheel event was not processed by the renderer. |
285 virtual void UnhandledWheelEvent(const WebKit::WebMouseWheelEvent& event) = 0; | 285 virtual void UnhandledWheelEvent(const blink::WebMouseWheelEvent& event) = 0; |
286 | 286 |
287 // Called prior to forwarding input event messages to the renderer, giving | 287 // Called prior to forwarding input event messages to the renderer, giving |
288 // the view a chance to perform in-process event filtering or processing. | 288 // the view a chance to perform in-process event filtering or processing. |
289 // Return values of |NOT_CONSUMED| or |UNKNOWN| will result in |input_event| | 289 // Return values of |NOT_CONSUMED| or |UNKNOWN| will result in |input_event| |
290 // being forwarded. | 290 // being forwarded. |
291 virtual InputEventAckState FilterInputEvent( | 291 virtual InputEventAckState FilterInputEvent( |
292 const WebKit::WebInputEvent& input_event) = 0; | 292 const blink::WebInputEvent& input_event) = 0; |
293 | 293 |
294 // Called by the host when it requires an input flush; the flush call should | 294 // Called by the host when it requires an input flush; the flush call should |
295 // by synchronized with BeginFrame. | 295 // by synchronized with BeginFrame. |
296 virtual void OnSetNeedsFlushInput() = 0; | 296 virtual void OnSetNeedsFlushInput() = 0; |
297 | 297 |
298 // Called by the host when the input flush has completed. | 298 // Called by the host when the input flush has completed. |
299 virtual void OnDidFlushInput() = 0; | 299 virtual void OnDidFlushInput() = 0; |
300 | 300 |
301 virtual void GestureEventAck(int gesture_event_type, | 301 virtual void GestureEventAck(int gesture_event_type, |
302 InputEventAckState ack_result) = 0; | 302 InputEventAckState ack_result) = 0; |
303 | 303 |
304 virtual void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, | 304 virtual void OnOverscrolled(gfx::Vector2dF accumulated_overscroll, |
305 gfx::Vector2dF current_fling_velocity) = 0; | 305 gfx::Vector2dF current_fling_velocity) = 0; |
306 | 306 |
307 virtual void SetPopupType(WebKit::WebPopupType popup_type) = 0; | 307 virtual void SetPopupType(blink::WebPopupType popup_type) = 0; |
308 virtual WebKit::WebPopupType GetPopupType() = 0; | 308 virtual blink::WebPopupType GetPopupType() = 0; |
309 | 309 |
310 virtual BrowserAccessibilityManager* | 310 virtual BrowserAccessibilityManager* |
311 GetBrowserAccessibilityManager() const = 0; | 311 GetBrowserAccessibilityManager() const = 0; |
312 virtual void OnAccessibilityEvents( | 312 virtual void OnAccessibilityEvents( |
313 const std::vector<AccessibilityHostMsg_EventParams>& params) = 0; | 313 const std::vector<AccessibilityHostMsg_EventParams>& params) = 0; |
314 | 314 |
315 // Return a value that is incremented each time the renderer swaps a new frame | 315 // Return a value that is incremented each time the renderer swaps a new frame |
316 // to the view. | 316 // to the view. |
317 virtual uint32 RendererFrameNumber() = 0; | 317 virtual uint32 RendererFrameNumber() = 0; |
318 // Called each time the RenderWidgetHost receives a new frame for display from | 318 // Called each time the RenderWidgetHost receives a new frame for display from |
(...skipping 24 matching lines...) Expand all Loading... |
343 | 343 |
344 #if defined(OS_WIN) && defined(USE_AURA) | 344 #if defined(OS_WIN) && defined(USE_AURA) |
345 virtual void SetParentNativeViewAccessible( | 345 virtual void SetParentNativeViewAccessible( |
346 gfx::NativeViewAccessible accessible_parent) = 0; | 346 gfx::NativeViewAccessible accessible_parent) = 0; |
347 #endif | 347 #endif |
348 }; | 348 }; |
349 | 349 |
350 } // namespace content | 350 } // namespace content |
351 | 351 |
352 #endif // CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ | 352 #endif // CONTENT_PORT_BROWSER_RENDER_WIDGET_HOST_VIEW_PORT_H_ |
OLD | NEW |