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