Chromium Code Reviews| 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_RENDERER_RENDER_WIDGET_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 | 45 |
| 46 namespace WebKit { | 46 namespace WebKit { |
| 47 class WebGestureEvent; | 47 class WebGestureEvent; |
| 48 class WebInputEvent; | 48 class WebInputEvent; |
| 49 class WebMouseEvent; | 49 class WebMouseEvent; |
| 50 class WebTouchEvent; | 50 class WebTouchEvent; |
| 51 struct WebPoint; | 51 struct WebPoint; |
| 52 struct WebRenderingStatsImpl; | 52 struct WebRenderingStatsImpl; |
| 53 } | 53 } |
| 54 | 54 |
| 55 namespace cc { class OutputSurface; } | 55 namespace cc { |
| 56 class InputHandlerClient; | |
| 57 class OutputSurface; | |
| 58 } | |
| 56 | 59 |
| 57 namespace ui { | 60 namespace ui { |
| 58 class Range; | 61 class Range; |
| 59 } | 62 } |
| 60 | 63 |
| 61 namespace webkit { | 64 namespace webkit { |
| 62 namespace npapi { | 65 namespace npapi { |
| 63 struct WebPluginGeometry; | 66 struct WebPluginGeometry; |
| 64 } // namespace npapi | 67 } // namespace npapi |
| 65 | 68 |
| 66 namespace ppapi { | 69 namespace ppapi { |
| 67 class PluginInstance; | 70 class PluginInstance; |
| 68 } // namespace ppapi | 71 } // namespace ppapi |
| 69 } // namespace webkit | 72 } // namespace webkit |
| 70 | 73 |
| 71 namespace content { | 74 namespace content { |
| 72 struct GpuRenderingStats; | 75 struct GpuRenderingStats; |
| 73 class RenderWidgetCompositor; | 76 class RenderWidgetCompositor; |
| 74 class RenderWidgetTest; | 77 class RenderWidgetTest; |
| 78 class SynchronousCompositorImpl; | |
| 75 | 79 |
| 76 // RenderWidget provides a communication bridge between a WebWidget and | 80 // RenderWidget provides a communication bridge between a WebWidget and |
| 77 // a RenderWidgetHost, the latter of which lives in a different process. | 81 // a RenderWidgetHost, the latter of which lives in a different process. |
| 78 class CONTENT_EXPORT RenderWidget | 82 class CONTENT_EXPORT RenderWidget |
| 79 : public IPC::Listener, | 83 : public IPC::Listener, |
| 80 public IPC::Sender, | 84 public IPC::Sender, |
| 81 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), | 85 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), |
| 82 NON_EXPORTED_BASE(public WebGraphicsContext3DSwapBuffersClient), | 86 NON_EXPORTED_BASE(public WebGraphicsContext3DSwapBuffersClient), |
| 83 public base::RefCounted<RenderWidget> { | 87 public base::RefCounted<RenderWidget> { |
| 84 public: | 88 public: |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 | 171 |
| 168 // Fills in a GpuRenderingStats struct containing information about | 172 // Fills in a GpuRenderingStats struct containing information about |
| 169 // GPU rendering, e.g. count of texture uploads performed, time spent | 173 // GPU rendering, e.g. count of texture uploads performed, time spent |
| 170 // uploading. | 174 // uploading. |
| 171 // This call is relatively expensive as it blocks on the GPU process | 175 // This call is relatively expensive as it blocks on the GPU process |
| 172 bool GetGpuRenderingStats(GpuRenderingStats*) const; | 176 bool GetGpuRenderingStats(GpuRenderingStats*) const; |
| 173 | 177 |
| 174 RenderWidgetCompositor* compositor() const; | 178 RenderWidgetCompositor* compositor() const; |
| 175 | 179 |
| 176 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); | 180 virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(); |
| 181 scoped_ptr<cc::InputHandlerClient> CreateInputHandlerClient(); | |
| 177 | 182 |
| 178 // Callback for use with BeginSmoothScroll. | 183 // Callback for use with BeginSmoothScroll. |
| 179 typedef base::Callback<void()> SmoothScrollCompletionCallback; | 184 typedef base::Callback<void()> SmoothScrollCompletionCallback; |
| 180 | 185 |
| 181 // Directs the host to begin a smooth scroll. This scroll should have the same | 186 // Directs the host to begin a smooth scroll. This scroll should have the same |
| 182 // performance characteristics as a user-initiated scroll. Returns an ID of | 187 // performance characteristics as a user-initiated scroll. Returns an ID of |
| 183 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be | 188 // the scroll gesture. |mouse_event_x| and |mouse_event_y| are expected to be |
| 184 // in local DIP coordinates. | 189 // in local DIP coordinates. |
| 185 void BeginSmoothScroll(bool scroll_down, | 190 void BeginSmoothScroll(bool scroll_down, |
| 186 const SmoothScrollCompletionCallback& callback, | 191 const SmoothScrollCompletionCallback& callback, |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 482 // at the given point. | 487 // at the given point. |
| 483 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; | 488 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; |
| 484 | 489 |
| 485 // Check whether the WebWidget has any touch event handlers registered. | 490 // Check whether the WebWidget has any touch event handlers registered. |
| 486 virtual void hasTouchEventHandlers(bool has_handlers); | 491 virtual void hasTouchEventHandlers(bool has_handlers); |
| 487 | 492 |
| 488 // Creates a 3D context associated with this view. | 493 // Creates a 3D context associated with this view. |
| 489 WebGraphicsContext3DCommandBufferImpl* CreateGraphicsContext3D( | 494 WebGraphicsContext3DCommandBufferImpl* CreateGraphicsContext3D( |
| 490 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 495 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
| 491 | 496 |
| 497 // Lazily creates the synchronous compositor on first call. | |
| 498 SynchronousCompositorImpl* GetSynchronousCompositor(); | |
| 499 | |
| 492 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); | 500 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); |
| 493 | 501 |
| 494 // Routing ID that allows us to communicate to the parent browser process | 502 // Routing ID that allows us to communicate to the parent browser process |
| 495 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. | 503 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
| 496 int32 routing_id_; | 504 int32 routing_id_; |
| 497 | 505 |
| 498 int32 surface_id_; | 506 int32 surface_id_; |
| 499 | 507 |
| 500 // We are responsible for destroying this object via its Close method. | 508 // We are responsible for destroying this object via its Close method. |
| 501 WebKit::WebWidget* webwidget_; | 509 WebKit::WebWidget* webwidget_; |
| 502 | 510 |
| 503 // This is lazily constructed and must not outlive webwidget_. | 511 // This is lazily constructed and must not outlive webwidget_. |
| 504 scoped_ptr<RenderWidgetCompositor> compositor_; | 512 scoped_ptr<RenderWidgetCompositor> compositor_; |
| 505 | 513 |
| 514 // This is lazily constructed. | |
| 515 scoped_ptr<SynchronousCompositorImpl> synchronous_compositor_; | |
|
joth
2013/05/16 18:21:42
could be #if ANDROID .. ?
| |
| 516 | |
| 506 // Set to the ID of the view that initiated creating this view, if any. When | 517 // Set to the ID of the view that initiated creating this view, if any. When |
| 507 // the view was initiated by the browser (the common case), this will be | 518 // the view was initiated by the browser (the common case), this will be |
| 508 // MSG_ROUTING_NONE. This is used in determining ownership when opening | 519 // MSG_ROUTING_NONE. This is used in determining ownership when opening |
| 509 // child tabs. See RenderWidget::createWebViewWithRequest. | 520 // child tabs. See RenderWidget::createWebViewWithRequest. |
| 510 // | 521 // |
| 511 // This ID may refer to an invalid view if that view is closed before this | 522 // This ID may refer to an invalid view if that view is closed before this |
| 512 // view is. | 523 // view is. |
| 513 int32 opener_id_; | 524 int32 opener_id_; |
| 514 | 525 |
| 515 // The position where this view should be initially shown. | 526 // The position where this view should be initially shown. |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 694 bool is_threaded_compositing_enabled_; | 705 bool is_threaded_compositing_enabled_; |
| 695 | 706 |
| 696 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; | 707 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; |
| 697 | 708 |
| 698 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 709 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 699 }; | 710 }; |
| 700 | 711 |
| 701 } // namespace content | 712 } // namespace content |
| 702 | 713 |
| 703 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 714 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |