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 <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "ui/base/ime/text_input_mode.h" | 39 #include "ui/base/ime/text_input_mode.h" |
40 #include "ui/base/ime/text_input_type.h" | 40 #include "ui/base/ime/text_input_type.h" |
41 #include "ui/events/latency_info.h" | 41 #include "ui/events/latency_info.h" |
42 #include "ui/gfx/native_widget_types.h" | 42 #include "ui/gfx/native_widget_types.h" |
43 | 43 |
44 struct AcceleratedSurfaceMsg_BufferPresented_Params; | 44 struct AcceleratedSurfaceMsg_BufferPresented_Params; |
45 struct ViewHostMsg_BeginSmoothScroll_Params; | 45 struct ViewHostMsg_BeginSmoothScroll_Params; |
46 struct ViewHostMsg_SelectionBounds_Params; | 46 struct ViewHostMsg_SelectionBounds_Params; |
47 struct ViewHostMsg_TextInputState_Params; | 47 struct ViewHostMsg_TextInputState_Params; |
48 struct ViewHostMsg_UpdateRect_Params; | 48 struct ViewHostMsg_UpdateRect_Params; |
| 49 struct ViewMsg_Resize_Params; |
49 | 50 |
50 namespace base { | 51 namespace base { |
51 class TimeTicks; | 52 class TimeTicks; |
52 } | 53 } |
53 | 54 |
54 namespace cc { | 55 namespace cc { |
55 class CompositorFrame; | 56 class CompositorFrame; |
56 class CompositorFrameAck; | 57 class CompositorFrameAck; |
57 } | 58 } |
58 | 59 |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 void RejectMouseLockOrUnlockIfNecessary(); | 539 void RejectMouseLockOrUnlockIfNecessary(); |
539 bool IsMouseLocked() const; | 540 bool IsMouseLocked() const; |
540 | 541 |
541 // RenderViewHost overrides this method to report when in fullscreen mode. | 542 // RenderViewHost overrides this method to report when in fullscreen mode. |
542 virtual bool IsFullscreen() const; | 543 virtual bool IsFullscreen() const; |
543 | 544 |
544 // Indicates if the render widget host should track the render widget's size | 545 // Indicates if the render widget host should track the render widget's size |
545 // as opposed to visa versa. | 546 // as opposed to visa versa. |
546 void SetShouldAutoResize(bool enable); | 547 void SetShouldAutoResize(bool enable); |
547 | 548 |
| 549 // Fills in the |resize_params| struct. |
| 550 void GetResizeParams(ViewMsg_Resize_Params* resize_params); |
| 551 |
| 552 // Sets the |resize_params| that were sent to the renderer bundled with the |
| 553 // request to create a new RenderWidget. |
| 554 void SetInitialRenderSizeParams(const ViewMsg_Resize_Params& resize_params); |
| 555 |
548 // Expose increment/decrement of the in-flight event count, so | 556 // Expose increment/decrement of the in-flight event count, so |
549 // RenderViewHostImpl can account for in-flight beforeunload/unload events. | 557 // RenderViewHostImpl can account for in-flight beforeunload/unload events. |
550 int increment_in_flight_event_count() { return ++in_flight_event_count_; } | 558 int increment_in_flight_event_count() { return ++in_flight_event_count_; } |
551 int decrement_in_flight_event_count() { return --in_flight_event_count_; } | 559 int decrement_in_flight_event_count() { return --in_flight_event_count_; } |
552 | 560 |
553 // The View associated with the RenderViewHost. The lifetime of this object | 561 // The View associated with the RenderViewHost. The lifetime of this object |
554 // is associated with the lifetime of the Render process. If the Renderer | 562 // is associated with the lifetime of the Render process. If the Renderer |
555 // crashes, its View is destroyed and this pointer becomes NULL, even though | 563 // crashes, its View is destroyed and this pointer becomes NULL, even though |
556 // render_view_host_ lives on to load another URL (creating a new View while | 564 // render_view_host_ lives on to load another URL (creating a new View while |
557 // doing so). | 565 // doing so). |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 // The ID of the surface corresponding to this render widget. | 703 // The ID of the surface corresponding to this render widget. |
696 int surface_id_; | 704 int surface_id_; |
697 | 705 |
698 // Indicates whether a page is loading or not. | 706 // Indicates whether a page is loading or not. |
699 bool is_loading_; | 707 bool is_loading_; |
700 | 708 |
701 // Indicates whether a page is hidden or not. It has to stay in sync with the | 709 // Indicates whether a page is hidden or not. It has to stay in sync with the |
702 // most recent call to process_->WidgetRestored() / WidgetHidden(). | 710 // most recent call to process_->WidgetRestored() / WidgetHidden(). |
703 bool is_hidden_; | 711 bool is_hidden_; |
704 | 712 |
705 // Indicates whether a page is fullscreen or not. | |
706 bool is_fullscreen_; | |
707 | |
708 // Set if we are waiting for a repaint ack for the view. | 713 // Set if we are waiting for a repaint ack for the view. |
709 bool repaint_ack_pending_; | 714 bool repaint_ack_pending_; |
710 | 715 |
711 // True when waiting for RESIZE_ACK. | 716 // True when waiting for RESIZE_ACK. |
712 bool resize_ack_pending_; | 717 bool resize_ack_pending_; |
713 | 718 |
714 // Cached copy of the screen info so that it doesn't need to be updated every | 719 // Cached copy of the screen info so that it doesn't need to be updated every |
715 // time the window is resized. | 720 // time the window is resized. |
716 scoped_ptr<blink::WebScreenInfo> screen_info_; | 721 scoped_ptr<blink::WebScreenInfo> screen_info_; |
717 | 722 |
718 // Set if screen_info_ may have changed and should be recomputed and force a | 723 // Set if screen_info_ may have changed and should be recomputed and force a |
719 // resize message. | 724 // resize message. |
720 bool screen_info_out_of_date_; | 725 bool screen_info_out_of_date_; |
721 | 726 |
722 // The current size of the RenderWidget. | 727 // The current size of the RenderWidget. |
723 gfx::Size current_size_; | 728 gfx::Size current_size_; |
724 | 729 |
725 // The size of the view's backing surface in non-DPI-adjusted pixels. | 730 // Resize information that was previously sent to the renderer. |
726 gfx::Size physical_backing_size_; | 731 scoped_ptr<ViewMsg_Resize_Params> old_resize_params_; |
727 | |
728 // The amount that the viewport size given to Blink was shrunk by the URL-bar | |
729 // (always 0 on platforms where URL-bar hiding isn't supported). | |
730 float top_controls_layout_height_; | |
731 | |
732 // The size of the visible viewport, which may be smaller than the view if the | |
733 // view is partially occluded (e.g. by a virtual keyboard). The size is in | |
734 // DPI-adjusted pixels. | |
735 gfx::Size visible_viewport_size_; | |
736 | |
737 // The size we last sent as requested size to the renderer. |current_size_| | |
738 // is only updated once the resize message has been ack'd. This on the other | |
739 // hand is updated when the resize message is sent. This is very similar to | |
740 // |resize_ack_pending_|, but the latter is not set if the new size has width | |
741 // or height zero, which is why we need this too. | |
742 gfx::Size last_requested_size_; | |
743 | 732 |
744 // The next auto resize to send. | 733 // The next auto resize to send. |
745 gfx::Size new_auto_size_; | 734 gfx::Size new_auto_size_; |
746 | 735 |
747 // True if the render widget host should track the render widget's size as | 736 // True if the render widget host should track the render widget's size as |
748 // opposed to visa versa. | 737 // opposed to visa versa. |
749 bool should_auto_resize_; | 738 bool should_auto_resize_; |
750 | 739 |
751 bool waiting_for_screen_rects_ack_; | 740 bool waiting_for_screen_rects_ack_; |
752 gfx::Rect last_view_screen_rect_; | 741 gfx::Rect last_view_screen_rect_; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 cc::RollingTimeDeltaHistory browser_composite_latency_history_; | 835 cc::RollingTimeDeltaHistory browser_composite_latency_history_; |
847 | 836 |
848 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 837 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
849 | 838 |
850 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 839 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
851 }; | 840 }; |
852 | 841 |
853 } // namespace content | 842 } // namespace content |
854 | 843 |
855 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 844 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |