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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 // Expose increment/decrement of the in-flight event count, so | 499 // Expose increment/decrement of the in-flight event count, so |
500 // RenderViewHostImpl can account for in-flight beforeunload/unload events. | 500 // RenderViewHostImpl can account for in-flight beforeunload/unload events. |
501 int increment_in_flight_event_count() { return ++in_flight_event_count_; } | 501 int increment_in_flight_event_count() { return ++in_flight_event_count_; } |
502 int decrement_in_flight_event_count() { | 502 int decrement_in_flight_event_count() { |
503 DCHECK_GT(in_flight_event_count_, 0); | 503 DCHECK_GT(in_flight_event_count_, 0); |
504 return --in_flight_event_count_; | 504 return --in_flight_event_count_; |
505 } | 505 } |
506 | 506 |
507 bool renderer_initialized() const { return renderer_initialized_; } | 507 bool renderer_initialized() const { return renderer_initialized_; } |
508 | 508 |
| 509 void set_scale_input_to_viewport(bool scale_input_to_viewport) { |
| 510 scale_input_to_viewport_ = scale_input_to_viewport; |
| 511 } |
| 512 |
509 protected: | 513 protected: |
510 // Retrieves an id the renderer can use to refer to its view. | 514 // Retrieves an id the renderer can use to refer to its view. |
511 // This is used for various IPC messages, including plugins. | 515 // This is used for various IPC messages, including plugins. |
512 gfx::NativeViewId GetNativeViewId() const; | 516 gfx::NativeViewId GetNativeViewId() const; |
513 | 517 |
514 // --------------------------------------------------------------------------- | 518 // --------------------------------------------------------------------------- |
515 // The following method is overridden by RenderViewHost to send upwards to | 519 // The following method is overridden by RenderViewHost to send upwards to |
516 // its delegate. | 520 // its delegate. |
517 | 521 |
518 // Callback for notification that we failed to receive any rendered graphics | 522 // Callback for notification that we failed to receive any rendered graphics |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 // Indicates whether a RenderFramehost has ownership, in which case this | 809 // Indicates whether a RenderFramehost has ownership, in which case this |
806 // object does not self destroy. | 810 // object does not self destroy. |
807 bool owned_by_render_frame_host_; | 811 bool owned_by_render_frame_host_; |
808 | 812 |
809 // Indicates whether this RenderWidgetHost thinks is focused. This is trying | 813 // Indicates whether this RenderWidgetHost thinks is focused. This is trying |
810 // to match what the renderer process knows. It is different from | 814 // to match what the renderer process knows. It is different from |
811 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, | 815 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, |
812 // causing HasFocus to return false when is_focused_ is true. | 816 // causing HasFocus to return false when is_focused_ is true. |
813 bool is_focused_; | 817 bool is_focused_; |
814 | 818 |
| 819 // When true, the host will scale the input to viewport. |
| 820 // TODO(oshima): Remove this once crbug.com/563730 is addressed. |
| 821 bool scale_input_to_viewport_; |
| 822 |
815 // This value indicates how long to wait before we consider a renderer hung. | 823 // This value indicates how long to wait before we consider a renderer hung. |
816 base::TimeDelta hung_renderer_delay_; | 824 base::TimeDelta hung_renderer_delay_; |
817 | 825 |
818 // This value indicates how long to wait for a new compositor frame from a | 826 // This value indicates how long to wait for a new compositor frame from a |
819 // renderer process before clearing any previously displayed content. | 827 // renderer process before clearing any previously displayed content. |
820 base::TimeDelta new_content_rendering_delay_; | 828 base::TimeDelta new_content_rendering_delay_; |
821 | 829 |
822 // Timer used to batch together mouse wheel events for the delegate | 830 // Timer used to batch together mouse wheel events for the delegate |
823 // OnUserInteraction method. A wheel event is only dispatched when a wheel | 831 // OnUserInteraction method. A wheel event is only dispatched when a wheel |
824 // event has not been seen for kMouseWheelCoalesceInterval seconds prior. | 832 // event has not been seen for kMouseWheelCoalesceInterval seconds prior. |
825 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; | 833 scoped_ptr<base::ElapsedTimer> mouse_wheel_coalesce_timer_; |
826 | 834 |
827 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 835 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
828 | 836 |
829 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 837 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
830 }; | 838 }; |
831 | 839 |
832 } // namespace content | 840 } // namespace content |
833 | 841 |
834 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 842 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |