Chromium Code Reviews| 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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 void RejectMouseLockOrUnlockIfNecessary(); | 535 void RejectMouseLockOrUnlockIfNecessary(); |
| 535 bool IsMouseLocked() const; | 536 bool IsMouseLocked() const; |
| 536 | 537 |
| 537 // RenderViewHost overrides this method to report when in fullscreen mode. | 538 // RenderViewHost overrides this method to report when in fullscreen mode. |
| 538 virtual bool IsFullscreen() const; | 539 virtual bool IsFullscreen() const; |
| 539 | 540 |
| 540 // Indicates if the render widget host should track the render widget's size | 541 // Indicates if the render widget host should track the render widget's size |
| 541 // as opposed to visa versa. | 542 // as opposed to visa versa. |
| 542 void SetShouldAutoResize(bool enable); | 543 void SetShouldAutoResize(bool enable); |
| 543 | 544 |
| 545 // Fills in the |resize_params| struct for when creating a new RenderView. | |
| 546 // Calling this method will have side-effects as it will assume the | |
| 547 // information has been sent to the renderer. | |
| 548 void GetNewViewResizeParams(ViewMsg_Resize_Params* resize_params); | |
| 549 | |
| 544 // Expose increment/decrement of the in-flight event count, so | 550 // Expose increment/decrement of the in-flight event count, so |
| 545 // RenderViewHostImpl can account for in-flight beforeunload/unload events. | 551 // RenderViewHostImpl can account for in-flight beforeunload/unload events. |
| 546 int increment_in_flight_event_count() { return ++in_flight_event_count_; } | 552 int increment_in_flight_event_count() { return ++in_flight_event_count_; } |
| 547 int decrement_in_flight_event_count() { return --in_flight_event_count_; } | 553 int decrement_in_flight_event_count() { return --in_flight_event_count_; } |
| 548 | 554 |
| 549 // The View associated with the RenderViewHost. The lifetime of this object | 555 // The View associated with the RenderViewHost. The lifetime of this object |
| 550 // is associated with the lifetime of the Render process. If the Renderer | 556 // is associated with the lifetime of the Render process. If the Renderer |
| 551 // crashes, its View is destroyed and this pointer becomes NULL, even though | 557 // crashes, its View is destroyed and this pointer becomes NULL, even though |
| 552 // render_view_host_ lives on to load another URL (creating a new View while | 558 // render_view_host_ lives on to load another URL (creating a new View while |
| 553 // doing so). | 559 // doing so). |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 574 void Destroy(); | 580 void Destroy(); |
| 575 | 581 |
| 576 // Called by |hang_timeout_monitor_| on delayed response from the renderer. | 582 // Called by |hang_timeout_monitor_| on delayed response from the renderer. |
| 577 void RendererIsUnresponsive(); | 583 void RendererIsUnresponsive(); |
| 578 | 584 |
| 579 // Called if we know the renderer is responsive. When we currently think the | 585 // Called if we know the renderer is responsive. When we currently think the |
| 580 // renderer is unresponsive, this will clear that state and call | 586 // renderer is unresponsive, this will clear that state and call |
| 581 // NotifyRendererResponsive. | 587 // NotifyRendererResponsive. |
| 582 void RendererIsResponsive(); | 588 void RendererIsResponsive(); |
| 583 | 589 |
| 590 // Fills in the |resize_params| struct. | |
| 591 void GetResizeParams(ViewMsg_Resize_Params* resize_params); | |
| 592 | |
| 584 // IPC message handlers | 593 // IPC message handlers |
| 585 void OnRenderViewReady(); | 594 void OnRenderViewReady(); |
| 586 void OnRenderProcessGone(int status, int error_code); | 595 void OnRenderProcessGone(int status, int error_code); |
| 587 void OnClose(); | 596 void OnClose(); |
| 588 void OnUpdateScreenRectsAck(); | 597 void OnUpdateScreenRectsAck(); |
| 589 void OnRequestMove(const gfx::Rect& pos); | 598 void OnRequestMove(const gfx::Rect& pos); |
| 590 void OnSetTooltipText(const base::string16& tooltip_text, | 599 void OnSetTooltipText(const base::string16& tooltip_text, |
| 591 blink::WebTextDirection text_direction_hint); | 600 blink::WebTextDirection text_direction_hint); |
| 592 bool OnSwapCompositorFrame(const IPC::Message& message); | 601 bool OnSwapCompositorFrame(const IPC::Message& message); |
| 593 void OnFlingingStopped(); | 602 void OnFlingingStopped(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 691 // The ID of the surface corresponding to this render widget. | 700 // The ID of the surface corresponding to this render widget. |
| 692 int surface_id_; | 701 int surface_id_; |
| 693 | 702 |
| 694 // Indicates whether a page is loading or not. | 703 // Indicates whether a page is loading or not. |
| 695 bool is_loading_; | 704 bool is_loading_; |
| 696 | 705 |
| 697 // Indicates whether a page is hidden or not. It has to stay in sync with the | 706 // Indicates whether a page is hidden or not. It has to stay in sync with the |
| 698 // most recent call to process_->WidgetRestored() / WidgetHidden(). | 707 // most recent call to process_->WidgetRestored() / WidgetHidden(). |
| 699 bool is_hidden_; | 708 bool is_hidden_; |
| 700 | 709 |
| 701 // Indicates whether a page is fullscreen or not. | |
| 702 bool is_fullscreen_; | |
| 703 | |
| 704 // Set if we are waiting for a repaint ack for the view. | 710 // Set if we are waiting for a repaint ack for the view. |
| 705 bool repaint_ack_pending_; | 711 bool repaint_ack_pending_; |
| 706 | 712 |
| 707 // True when waiting for RESIZE_ACK. | 713 // True when waiting for RESIZE_ACK. |
| 708 bool resize_ack_pending_; | 714 bool resize_ack_pending_; |
| 709 | 715 |
| 710 // Cached copy of the screen info so that it doesn't need to be updated every | 716 // Cached copy of the screen info so that it doesn't need to be updated every |
| 711 // time the window is resized. | 717 // time the window is resized. |
| 712 scoped_ptr<blink::WebScreenInfo> screen_info_; | 718 scoped_ptr<blink::WebScreenInfo> screen_info_; |
| 713 | 719 |
| 714 // Set if screen_info_ may have changed and should be recomputed and force a | 720 // Set if screen_info_ may have changed and should be recomputed and force a |
| 715 // resize message. | 721 // resize message. |
| 716 bool screen_info_out_of_date_; | 722 bool screen_info_out_of_date_; |
| 717 | 723 |
| 718 // The current size of the RenderWidget. | 724 // The current size of the RenderWidget. |
| 719 gfx::Size current_size_; | 725 gfx::Size current_size_; |
| 720 | 726 |
| 721 // The size of the view's backing surface in non-DPI-adjusted pixels. | 727 // Resize information that was previously sent to the renderer. |
| 722 gfx::Size physical_backing_size_; | 728 scoped_ptr<ViewMsg_Resize_Params> old_resize_params_; |
|
piman
2014/10/29 18:42:57
This is a nice simplification.
mkosiba (inactive)
2014/10/31 14:35:06
Thanks!
| |
| 723 | |
| 724 // The amount that the viewport size given to Blink was shrunk by the URL-bar | |
| 725 // (always 0 on platforms where URL-bar hiding isn't supported). | |
| 726 float top_controls_layout_height_; | |
| 727 | |
| 728 // The size of the visible viewport, which may be smaller than the view if the | |
| 729 // view is partially occluded (e.g. by a virtual keyboard). The size is in | |
| 730 // DPI-adjusted pixels. | |
| 731 gfx::Size visible_viewport_size_; | |
| 732 | 729 |
| 733 // The size we last sent as requested size to the renderer. |current_size_| | 730 // The size we last sent as requested size to the renderer. |current_size_| |
| 734 // is only updated once the resize message has been ack'd. This on the other | 731 // is only updated once the resize message has been ack'd. This on the other |
| 735 // hand is updated when the resize message is sent. This is very similar to | 732 // hand is updated when the resize message is sent. This is very similar to |
| 736 // |resize_ack_pending_|, but the latter is not set if the new size has width | 733 // |resize_ack_pending_|, but the latter is not set if the new size has width |
| 737 // or height zero, which is why we need this too. | 734 // or height zero, which is why we need this too. |
| 738 gfx::Size last_requested_size_; | 735 gfx::Size last_requested_size_; |
| 739 | 736 |
| 740 // The next auto resize to send. | 737 // The next auto resize to send. |
| 741 gfx::Size new_auto_size_; | 738 gfx::Size new_auto_size_; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 842 cc::RollingTimeDeltaHistory browser_composite_latency_history_; | 839 cc::RollingTimeDeltaHistory browser_composite_latency_history_; |
| 843 | 840 |
| 844 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 841 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 845 | 842 |
| 846 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 843 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 847 }; | 844 }; |
| 848 | 845 |
| 849 } // namespace content | 846 } // namespace content |
| 850 | 847 |
| 851 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 848 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |