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