Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.h

Issue 659093002: Pass the size to the RenderView on creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@java_enum
Patch Set: rebase Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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.
546 void GetResizeParams(ViewMsg_Resize_Params* resize_params);
547
548 // Sets the |resize_params| that were sent to the renderer bundled with the
549 // request to create a new RenderWidget.
550 void SetInitialRenderSizeParams(const ViewMsg_Resize_Params& resize_params);
551
544 // Expose increment/decrement of the in-flight event count, so 552 // Expose increment/decrement of the in-flight event count, so
545 // RenderViewHostImpl can account for in-flight beforeunload/unload events. 553 // RenderViewHostImpl can account for in-flight beforeunload/unload events.
546 int increment_in_flight_event_count() { return ++in_flight_event_count_; } 554 int increment_in_flight_event_count() { return ++in_flight_event_count_; }
547 int decrement_in_flight_event_count() { return --in_flight_event_count_; } 555 int decrement_in_flight_event_count() { return --in_flight_event_count_; }
548 556
549 // The View associated with the RenderViewHost. The lifetime of this object 557 // The View associated with the RenderViewHost. The lifetime of this object
550 // is associated with the lifetime of the Render process. If the Renderer 558 // 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 559 // 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 560 // render_view_host_ lives on to load another URL (creating a new View while
553 // doing so). 561 // doing so).
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 // The ID of the surface corresponding to this render widget. 699 // The ID of the surface corresponding to this render widget.
692 int surface_id_; 700 int surface_id_;
693 701
694 // Indicates whether a page is loading or not. 702 // Indicates whether a page is loading or not.
695 bool is_loading_; 703 bool is_loading_;
696 704
697 // Indicates whether a page is hidden or not. It has to stay in sync with the 705 // Indicates whether a page is hidden or not. It has to stay in sync with the
698 // most recent call to process_->WidgetRestored() / WidgetHidden(). 706 // most recent call to process_->WidgetRestored() / WidgetHidden().
699 bool is_hidden_; 707 bool is_hidden_;
700 708
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. 709 // Set if we are waiting for a repaint ack for the view.
705 bool repaint_ack_pending_; 710 bool repaint_ack_pending_;
706 711
707 // True when waiting for RESIZE_ACK. 712 // True when waiting for RESIZE_ACK.
708 bool resize_ack_pending_; 713 bool resize_ack_pending_;
709 714
710 // Cached copy of the screen info so that it doesn't need to be updated every 715 // Cached copy of the screen info so that it doesn't need to be updated every
711 // time the window is resized. 716 // time the window is resized.
712 scoped_ptr<blink::WebScreenInfo> screen_info_; 717 scoped_ptr<blink::WebScreenInfo> screen_info_;
713 718
714 // Set if screen_info_ may have changed and should be recomputed and force a 719 // Set if screen_info_ may have changed and should be recomputed and force a
715 // resize message. 720 // resize message.
716 bool screen_info_out_of_date_; 721 bool screen_info_out_of_date_;
717 722
718 // The current size of the RenderWidget. 723 // The current size of the RenderWidget.
719 gfx::Size current_size_; 724 gfx::Size current_size_;
720 725
721 // The size of the view's backing surface in non-DPI-adjusted pixels. 726 // Resize information that was previously sent to the renderer.
722 gfx::Size physical_backing_size_; 727 scoped_ptr<ViewMsg_Resize_Params> old_resize_params_;
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
733 // 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
735 // 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
737 // or height zero, which is why we need this too.
738 gfx::Size last_requested_size_;
739 728
740 // The next auto resize to send. 729 // The next auto resize to send.
741 gfx::Size new_auto_size_; 730 gfx::Size new_auto_size_;
742 731
743 // True if the render widget host should track the render widget's size as 732 // True if the render widget host should track the render widget's size as
744 // opposed to visa versa. 733 // opposed to visa versa.
745 bool should_auto_resize_; 734 bool should_auto_resize_;
746 735
747 bool waiting_for_screen_rects_ack_; 736 bool waiting_for_screen_rects_ack_;
748 gfx::Rect last_view_screen_rect_; 737 gfx::Rect last_view_screen_rect_;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 cc::RollingTimeDeltaHistory browser_composite_latency_history_; 831 cc::RollingTimeDeltaHistory browser_composite_latency_history_;
843 832
844 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; 833 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_;
845 834
846 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); 835 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl);
847 }; 836 };
848 837
849 } // namespace content 838 } // namespace content
850 839
851 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ 840 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698