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); | 554 bool GetResizeParams(ViewMsg_Resize_Params* resize_params) const; |
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 |
568 // The View associated with the RenderViewHost. The lifetime of this object | 572 // The View associated with the RenderViewHost. The lifetime of this object |
569 // is associated with the lifetime of the Render process. If the Renderer | 573 // is associated with the lifetime of the Render process. If the Renderer |
570 // crashes, its View is destroyed and this pointer becomes NULL, even though | 574 // crashes, its View is destroyed and this pointer becomes NULL, even though |
571 // render_view_host_ lives on to load another URL (creating a new View while | 575 // render_view_host_ lives on to load another URL (creating a new View while |
572 // doing so). | 576 // doing so). |
573 RenderWidgetHostViewBase* view_; | 577 RenderWidgetHostViewBase* view_; |
574 | 578 |
575 // A weak pointer to the view. The above pointer should be weak, but changing | 579 // A weak pointer to the view. The above pointer should be weak, but changing |
576 // that to be weak causes crashes on Android. | 580 // that to be weak causes crashes on Android. |
577 // TODO(ccameron): Fix this. | 581 // TODO(ccameron): Fix this. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 bool is_focused_; | 849 bool is_focused_; |
846 | 850 |
847 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 851 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
848 | 852 |
849 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 853 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
850 }; | 854 }; |
851 | 855 |
852 } // namespace content | 856 } // namespace content |
853 | 857 |
854 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 858 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |