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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // Emulates screen and widget metrics. Supplied values override everything | 234 // Emulates screen and widget metrics. Supplied values override everything |
235 // coming from host. | 235 // coming from host. |
236 void EnableScreenMetricsEmulation( | 236 void EnableScreenMetricsEmulation( |
237 const gfx::Size& device_size, | 237 const gfx::Size& device_size, |
238 const gfx::Rect& widget_rect, | 238 const gfx::Rect& widget_rect, |
239 float device_scale_factor, | 239 float device_scale_factor, |
240 bool fit_to_view); | 240 bool fit_to_view); |
241 void DisableScreenMetricsEmulation(); | 241 void DisableScreenMetricsEmulation(); |
242 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator); | 242 void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator); |
243 | 243 |
| 244 void ScheduleCompositeWithForcedRedraw(); |
| 245 |
244 protected: | 246 protected: |
245 // Friend RefCounted so that the dtor can be non-public. Using this class | 247 // Friend RefCounted so that the dtor can be non-public. Using this class |
246 // without ref-counting is an error. | 248 // without ref-counting is an error. |
247 friend class base::RefCounted<RenderWidget>; | 249 friend class base::RefCounted<RenderWidget>; |
248 // For unit tests. | 250 // For unit tests. |
249 friend class RenderWidgetTest; | 251 friend class RenderWidgetTest; |
250 | 252 |
251 enum ResizeAck { | 253 enum ResizeAck { |
252 SEND_RESIZE_ACK, | 254 SEND_RESIZE_ACK, |
253 NO_RESIZE_ACK, | 255 NO_RESIZE_ACK, |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 542 |
541 // Check whether the WebWidget has any touch event handlers registered. | 543 // Check whether the WebWidget has any touch event handlers registered. |
542 virtual void hasTouchEventHandlers(bool has_handlers); | 544 virtual void hasTouchEventHandlers(bool has_handlers); |
543 | 545 |
544 // Creates a 3D context associated with this view. | 546 // Creates a 3D context associated with this view. |
545 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( | 547 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( |
546 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 548 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
547 | 549 |
548 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); | 550 bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); |
549 | 551 |
| 552 void ScheduleCompositeImpl(bool force_redraw); |
| 553 |
550 // Routing ID that allows us to communicate to the parent browser process | 554 // Routing ID that allows us to communicate to the parent browser process |
551 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. | 555 // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. |
552 int32 routing_id_; | 556 int32 routing_id_; |
553 | 557 |
554 int32 surface_id_; | 558 int32 surface_id_; |
555 | 559 |
556 // We are responsible for destroying this object via its Close method. | 560 // We are responsible for destroying this object via its Close method. |
557 WebKit::WebWidget* webwidget_; | 561 WebKit::WebWidget* webwidget_; |
558 | 562 |
559 // This is lazily constructed and must not outlive webwidget_. | 563 // This is lazily constructed and must not outlive webwidget_. |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 float popup_origin_scale_for_emulation_; | 786 float popup_origin_scale_for_emulation_; |
783 | 787 |
784 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; | 788 base::WeakPtrFactory<RenderWidget> weak_ptr_factory_; |
785 | 789 |
786 DISALLOW_COPY_AND_ASSIGN(RenderWidget); | 790 DISALLOW_COPY_AND_ASSIGN(RenderWidget); |
787 }; | 791 }; |
788 | 792 |
789 } // namespace content | 793 } // namespace content |
790 | 794 |
791 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ | 795 #endif // CONTENT_RENDERER_RENDER_WIDGET_H_ |
OLD | NEW |