| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 namespace WebKit { | 47 namespace WebKit { |
| 48 class WebGestureEvent; | 48 class WebGestureEvent; |
| 49 class WebInputEvent; | 49 class WebInputEvent; |
| 50 class WebMouseEvent; | 50 class WebMouseEvent; |
| 51 class WebTouchEvent; | 51 class WebTouchEvent; |
| 52 struct WebPoint; | 52 struct WebPoint; |
| 53 struct WebRenderingStatsImpl; | 53 struct WebRenderingStatsImpl; |
| 54 } | 54 } |
| 55 | 55 |
| 56 namespace cc { class OutputSurface; } | 56 namespace cc { |
| 57 class InputHandlerClient; |
| 58 class OutputSurface; |
| 59 } |
| 57 | 60 |
| 58 namespace ui { | 61 namespace ui { |
| 59 class Range; | 62 class Range; |
| 60 } | 63 } |
| 61 | 64 |
| 62 namespace webkit { | 65 namespace webkit { |
| 63 namespace npapi { | 66 namespace npapi { |
| 64 struct WebPluginGeometry; | 67 struct WebPluginGeometry; |
| 65 } // namespace npapi | 68 } // namespace npapi |
| 66 | 69 |
| 67 namespace ppapi { | 70 namespace ppapi { |
| 68 class PluginInstance; | 71 class PluginInstance; |
| 69 } // namespace ppapi | 72 } // namespace ppapi |
| 70 } // namespace webkit | 73 } // namespace webkit |
| 71 | 74 |
| 72 namespace content { | 75 namespace content { |
| 73 struct GpuRenderingStats; | 76 struct GpuRenderingStats; |
| 74 class RenderWidgetCompositor; | 77 class RenderWidgetCompositor; |
| 75 class RenderWidgetTest; | 78 class RenderWidgetTest; |
| 79 class SynchronousCompositorImpl; |
| 76 | 80 |
| 77 // RenderWidget provides a communication bridge between a WebWidget and | 81 // RenderWidget provides a communication bridge between a WebWidget and |
| 78 // a RenderWidgetHost, the latter of which lives in a different process. | 82 // a RenderWidgetHost, the latter of which lives in a different process. |
| 79 class CONTENT_EXPORT RenderWidget | 83 class CONTENT_EXPORT RenderWidget |
| 80 : public IPC::Listener, | 84 : public IPC::Listener, |
| 81 public IPC::Sender, | 85 public IPC::Sender, |
| 82 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), | 86 NON_EXPORTED_BASE(virtual public WebKit::WebWidgetClient), |
| 83 NON_EXPORTED_BASE(public WebGraphicsContext3DSwapBuffersClient), | 87 NON_EXPORTED_BASE(public WebGraphicsContext3DSwapBuffersClient), |
| 84 public base::RefCounted<RenderWidget> { | 88 public base::RefCounted<RenderWidget> { |
| 85 public: | 89 public: |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 // at the given point. | 496 // at the given point. |
| 493 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; | 497 virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; |
| 494 | 498 |
| 495 // Check whether the WebWidget has any touch event handlers registered. | 499 // Check whether the WebWidget has any touch event handlers registered. |
| 496 virtual void hasTouchEventHandlers(bool has_handlers); | 500 virtual void hasTouchEventHandlers(bool has_handlers); |
| 497 | 501 |
| 498 // Creates a 3D context associated with this view. | 502 // Creates a 3D context associated with this view. |
| 499 WebGraphicsContext3DCommandBufferImpl* CreateGraphicsContext3D( | 503 WebGraphicsContext3DCommandBufferImpl* CreateGraphicsContext3D( |
| 500 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 504 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
| 501 | 505 |
| 506 // Lazily creates the synchronous compositor on first call. |
| 507 SynchronousCompositorImpl* GetSynchronousCompositor(); |
| 508 |
| 502 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); | 509 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); |
| 503 | 510 |
| 504 // Routing ID that allows us to communicate to the parent browser process | 511 // Routing ID that allows us to communicate to the parent browser process |
| 505 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. | 512 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
| 506 int32 routing_id_; | 513 int32 routing_id_; |
| 507 | 514 |
| 508 int32 surface_id_; | 515 int32 surface_id_; |
| 509 | 516 |
| 510 // We are responsible for destroying this object via its Close method. | 517 // We are responsible for destroying this object via its Close method. |
| 511 WebKit::WebWidget* webwidget_; | 518 WebKit::WebWidget* webwidget_; |
| 512 | 519 |
| 513 // This is lazily constructed and must not outlive webwidget_. | 520 // This is lazily constructed and must not outlive webwidget_. |
| 514 scoped_ptr<RenderWidgetCompositor> compositor_; | 521 scoped_ptr<RenderWidgetCompositor> compositor_; |
| 515 | 522 |
| 523 #if defined(OS_ANDROID) |
| 524 // This is lazily constructed. |
| 525 scoped_ptr<SynchronousCompositorImpl> synchronous_compositor_; |
| 526 #endif |
| 527 |
| 516 // Set to the ID of the view that initiated creating this view, if any. When | 528 // Set to the ID of the view that initiated creating this view, if any. When |
| 517 // the view was initiated by the browser (the common case), this will be | 529 // the view was initiated by the browser (the common case), this will be |
| 518 // MSG_ROUTING_NONE. This is used in determining ownership when opening | 530 // MSG_ROUTING_NONE. This is used in determining ownership when opening |
| 519 // child tabs. See RenderWidget::createWebViewWithRequest. | 531 // child tabs. See RenderWidget::createWebViewWithRequest. |
| 520 // | 532 // |
| 521 // This ID may refer to an invalid view if that view is closed before this | 533 // This ID may refer to an invalid view if that view is closed before this |
| 522 // view is. | 534 // view is. |
| 523 int32 opener_id_; | 535 int32 opener_id_; |
| 524 | 536 |
| 525 // The position where this view should be initially shown. | 537 // The position where this view should be initially shown. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 bool overscroll_notifications_enabled_; | 725 bool overscroll_notifications_enabled_; |
| 714 | 726 |
| 715 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; | 727 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; |
| 716 | 728 |
| 717 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 729 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
| 718 }; | 730 }; |
| 719 | 731 |
| 720 } // namespace content | 732 } // namespace content |
| 721 | 733 |
| 722 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 734 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
| OLD | NEW |