| 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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 // Expose increment/decrement of the in-flight event count, so | 501 // Expose increment/decrement of the in-flight event count, so |
| 502 // RenderViewHostImpl can account for in-flight beforeunload/unload events. | 502 // RenderViewHostImpl can account for in-flight beforeunload/unload events. |
| 503 int increment_in_flight_event_count() { return ++in_flight_event_count_; } | 503 int increment_in_flight_event_count() { return ++in_flight_event_count_; } |
| 504 int decrement_in_flight_event_count() { | 504 int decrement_in_flight_event_count() { |
| 505 DCHECK_GT(in_flight_event_count_, 0); | 505 DCHECK_GT(in_flight_event_count_, 0); |
| 506 return --in_flight_event_count_; | 506 return --in_flight_event_count_; |
| 507 } | 507 } |
| 508 | 508 |
| 509 bool renderer_initialized() const { return renderer_initialized_; } | 509 bool renderer_initialized() const { return renderer_initialized_; } |
| 510 | 510 |
| 511 bool scale_input_to_viewport() const { return scale_input_to_viewport_; } | |
| 512 void set_scale_input_to_viewport(bool scale_input_to_viewport) { | |
| 513 scale_input_to_viewport_ = scale_input_to_viewport; | |
| 514 } | |
| 515 | |
| 516 protected: | 511 protected: |
| 517 // --------------------------------------------------------------------------- | 512 // --------------------------------------------------------------------------- |
| 518 // The following method is overridden by RenderViewHost to send upwards to | 513 // The following method is overridden by RenderViewHost to send upwards to |
| 519 // its delegate. | 514 // its delegate. |
| 520 | 515 |
| 521 // Callback for notification that we failed to receive any rendered graphics | 516 // Callback for notification that we failed to receive any rendered graphics |
| 522 // from a newly loaded page. Used for testing. | 517 // from a newly loaded page. Used for testing. |
| 523 virtual void NotifyNewContentRenderingTimeoutForTesting() {} | 518 virtual void NotifyNewContentRenderingTimeoutForTesting() {} |
| 524 | 519 |
| 525 // --------------------------------------------------------------------------- | 520 // --------------------------------------------------------------------------- |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 // Indicates whether a RenderFramehost has ownership, in which case this | 794 // Indicates whether a RenderFramehost has ownership, in which case this |
| 800 // object does not self destroy. | 795 // object does not self destroy. |
| 801 bool owned_by_render_frame_host_; | 796 bool owned_by_render_frame_host_; |
| 802 | 797 |
| 803 // Indicates whether this RenderWidgetHost thinks is focused. This is trying | 798 // Indicates whether this RenderWidgetHost thinks is focused. This is trying |
| 804 // to match what the renderer process knows. It is different from | 799 // to match what the renderer process knows. It is different from |
| 805 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, | 800 // RenderWidgetHostView::HasFocus in that in that the focus request may fail, |
| 806 // causing HasFocus to return false when is_focused_ is true. | 801 // causing HasFocus to return false when is_focused_ is true. |
| 807 bool is_focused_; | 802 bool is_focused_; |
| 808 | 803 |
| 809 // When true, the host will scale the input to viewport. | |
| 810 // TODO(oshima): Remove this once crbug.com/563730 is addressed. | |
| 811 bool scale_input_to_viewport_; | |
| 812 | |
| 813 // This value indicates how long to wait before we consider a renderer hung. | 804 // This value indicates how long to wait before we consider a renderer hung. |
| 814 base::TimeDelta hung_renderer_delay_; | 805 base::TimeDelta hung_renderer_delay_; |
| 815 | 806 |
| 816 // This value indicates how long to wait for a new compositor frame from a | 807 // This value indicates how long to wait for a new compositor frame from a |
| 817 // renderer process before clearing any previously displayed content. | 808 // renderer process before clearing any previously displayed content. |
| 818 base::TimeDelta new_content_rendering_delay_; | 809 base::TimeDelta new_content_rendering_delay_; |
| 819 | 810 |
| 820 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 811 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 821 | 812 |
| 822 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 813 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 823 }; | 814 }; |
| 824 | 815 |
| 825 } // namespace content | 816 } // namespace content |
| 826 | 817 |
| 827 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 818 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |