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