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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 virtual bool IsFullscreenGranted() const; | 544 virtual bool IsFullscreenGranted() const; |
545 | 545 |
546 // Indicates if the render widget host should track the render widget's size | 546 // Indicates if the render widget host should track the render widget's size |
547 // as opposed to visa versa. | 547 // as opposed to visa versa. |
548 void SetAutoResize(bool enable, | 548 void SetAutoResize(bool enable, |
549 const gfx::Size& min_size, | 549 const gfx::Size& min_size, |
550 const gfx::Size& max_size); | 550 const gfx::Size& max_size); |
551 | 551 |
552 // Fills in the |resize_params| struct. | 552 // Fills in the |resize_params| struct. |
553 // Returns |false| if the update is redundant, |true| otherwise. | 553 // Returns |false| if the update is redundant, |true| otherwise. |
554 bool GetResizeParams(ViewMsg_Resize_Params* resize_params) const; | 554 bool GetResizeParams(ViewMsg_Resize_Params* resize_params); |
555 | 555 |
556 // Sets the |resize_params| that were sent to the renderer bundled with the | 556 // Sets the |resize_params| that were sent to the renderer bundled with the |
557 // request to create a new RenderWidget. | 557 // request to create a new RenderWidget. |
558 void SetInitialRenderSizeParams(const ViewMsg_Resize_Params& resize_params); | 558 void SetInitialRenderSizeParams(const ViewMsg_Resize_Params& resize_params); |
559 | 559 |
560 // Expose increment/decrement of the in-flight event count, so | 560 // Expose increment/decrement of the in-flight event count, so |
561 // RenderViewHostImpl can account for in-flight beforeunload/unload events. | 561 // RenderViewHostImpl can account for in-flight beforeunload/unload events. |
562 int increment_in_flight_event_count() { return ++in_flight_event_count_; } | 562 int increment_in_flight_event_count() { return ++in_flight_event_count_; } |
563 int decrement_in_flight_event_count() { | 563 int decrement_in_flight_event_count() { |
564 DCHECK_GT(in_flight_event_count_, 0); | 564 DCHECK_GT(in_flight_event_count_, 0); |
565 return --in_flight_event_count_; | 565 return --in_flight_event_count_; |
566 } | 566 } |
567 | 567 |
568 // Update screen_info_ if needed. | |
569 // Returns whether screen_info_ was updated. | |
570 bool UpdateScreenInfo(); | |
571 | |
572 // The View associated with the RenderViewHost. The lifetime of this object | 568 // The View associated with the RenderViewHost. The lifetime of this object |
573 // is associated with the lifetime of the Render process. If the Renderer | 569 // is associated with the lifetime of the Render process. If the Renderer |
574 // crashes, its View is destroyed and this pointer becomes NULL, even though | 570 // crashes, its View is destroyed and this pointer becomes NULL, even though |
575 // render_view_host_ lives on to load another URL (creating a new View while | 571 // render_view_host_ lives on to load another URL (creating a new View while |
576 // doing so). | 572 // doing so). |
577 RenderWidgetHostViewBase* view_; | 573 RenderWidgetHostViewBase* view_; |
578 | 574 |
579 // A weak pointer to the view. The above pointer should be weak, but changing | 575 // A weak pointer to the view. The above pointer should be weak, but changing |
580 // that to be weak causes crashes on Android. | 576 // that to be weak causes crashes on Android. |
581 // TODO(ccameron): Fix this. | 577 // TODO(ccameron): Fix this. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 bool is_focused_; | 845 bool is_focused_; |
850 | 846 |
851 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 847 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
852 | 848 |
853 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 849 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
854 }; | 850 }; |
855 | 851 |
856 } // namespace content | 852 } // namespace content |
857 | 853 |
858 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 854 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |