| 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 #include "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 resize_params->resizer_rect = GetRootWindowResizerRect(); | 585 resize_params->resizer_rect = GetRootWindowResizerRect(); |
| 586 | 586 |
| 587 if (view_) { | 587 if (view_) { |
| 588 resize_params->new_size = view_->GetRequestedRendererSize(); | 588 resize_params->new_size = view_->GetRequestedRendererSize(); |
| 589 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); | 589 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); |
| 590 resize_params->top_controls_height = view_->GetTopControlsHeight(); | 590 resize_params->top_controls_height = view_->GetTopControlsHeight(); |
| 591 resize_params->top_controls_shrink_blink_size = | 591 resize_params->top_controls_shrink_blink_size = |
| 592 view_->DoTopControlsShrinkBlinkSize(); | 592 view_->DoTopControlsShrinkBlinkSize(); |
| 593 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); | 593 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); |
| 594 resize_params->is_fullscreen = IsFullscreen(); | 594 resize_params->is_fullscreen = IsFullscreen(); |
| 595 resize_params->display_mode = GetDisplayMode(); |
| 595 } | 596 } |
| 596 | 597 |
| 597 const bool size_changed = | 598 const bool size_changed = |
| 598 !old_resize_params_ || | 599 !old_resize_params_ || |
| 599 old_resize_params_->new_size != resize_params->new_size || | 600 old_resize_params_->new_size != resize_params->new_size || |
| 600 (old_resize_params_->physical_backing_size.IsEmpty() && | 601 (old_resize_params_->physical_backing_size.IsEmpty() && |
| 601 !resize_params->physical_backing_size.IsEmpty()); | 602 !resize_params->physical_backing_size.IsEmpty()); |
| 602 bool dirty = | 603 bool dirty = |
| 603 size_changed || screen_info_out_of_date_ || | 604 size_changed || screen_info_out_of_date_ || |
| 604 old_resize_params_->physical_backing_size != | 605 old_resize_params_->physical_backing_size != |
| 605 resize_params->physical_backing_size || | 606 resize_params->physical_backing_size || |
| 606 old_resize_params_->is_fullscreen != resize_params->is_fullscreen || | 607 old_resize_params_->is_fullscreen != resize_params->is_fullscreen || |
| 608 old_resize_params_->display_mode != resize_params->display_mode || |
| 607 old_resize_params_->top_controls_height != | 609 old_resize_params_->top_controls_height != |
| 608 resize_params->top_controls_height || | 610 resize_params->top_controls_height || |
| 609 old_resize_params_->top_controls_shrink_blink_size != | 611 old_resize_params_->top_controls_shrink_blink_size != |
| 610 resize_params->top_controls_shrink_blink_size || | 612 resize_params->top_controls_shrink_blink_size || |
| 611 old_resize_params_->visible_viewport_size != | 613 old_resize_params_->visible_viewport_size != |
| 612 resize_params->visible_viewport_size; | 614 resize_params->visible_viewport_size; |
| 613 | 615 |
| 614 // We don't expect to receive an ACK when the requested size or the physical | 616 // We don't expect to receive an ACK when the requested size or the physical |
| 615 // backing size is empty, or when the main viewport size didn't change. | 617 // backing size is empty, or when the main viewport size didn't change. |
| 616 resize_params->needs_resize_ack = | 618 resize_params->needs_resize_ack = |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 } | 1316 } |
| 1315 | 1317 |
| 1316 bool RenderWidgetHostImpl::IsMouseLocked() const { | 1318 bool RenderWidgetHostImpl::IsMouseLocked() const { |
| 1317 return view_ ? view_->IsMouseLocked() : false; | 1319 return view_ ? view_->IsMouseLocked() : false; |
| 1318 } | 1320 } |
| 1319 | 1321 |
| 1320 bool RenderWidgetHostImpl::IsFullscreen() const { | 1322 bool RenderWidgetHostImpl::IsFullscreen() const { |
| 1321 return false; | 1323 return false; |
| 1322 } | 1324 } |
| 1323 | 1325 |
| 1326 blink::WebDisplayMode RenderWidgetHostImpl::GetDisplayMode() const { |
| 1327 return blink::WebDisplayModeBrowser; |
| 1328 } |
| 1329 |
| 1324 void RenderWidgetHostImpl::SetAutoResize(bool enable, | 1330 void RenderWidgetHostImpl::SetAutoResize(bool enable, |
| 1325 const gfx::Size& min_size, | 1331 const gfx::Size& min_size, |
| 1326 const gfx::Size& max_size) { | 1332 const gfx::Size& max_size) { |
| 1327 auto_resize_enabled_ = enable; | 1333 auto_resize_enabled_ = enable; |
| 1328 min_size_for_auto_resize_ = min_size; | 1334 min_size_for_auto_resize_ = min_size; |
| 1329 max_size_for_auto_resize_ = max_size; | 1335 max_size_for_auto_resize_ = max_size; |
| 1330 } | 1336 } |
| 1331 | 1337 |
| 1332 void RenderWidgetHostImpl::Cleanup() { | 1338 void RenderWidgetHostImpl::Cleanup() { |
| 1333 if (view_) { | 1339 if (view_) { |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 } | 2125 } |
| 2120 #endif | 2126 #endif |
| 2121 | 2127 |
| 2122 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2128 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2123 if (view_) | 2129 if (view_) |
| 2124 return view_->PreferredReadbackFormat(); | 2130 return view_->PreferredReadbackFormat(); |
| 2125 return kN32_SkColorType; | 2131 return kN32_SkColorType; |
| 2126 } | 2132 } |
| 2127 | 2133 |
| 2128 } // namespace content | 2134 } // namespace content |
| OLD | NEW |