| 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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 resize_params->screen_info = *screen_info_; | 587 resize_params->screen_info = *screen_info_; |
| 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 // TODO: 'is_fullscreen' is not a correct name here, |
| 598 // see crbug.com/474765. |
| 597 resize_params->is_fullscreen = IsFullscreen(); | 599 resize_params->is_fullscreen = IsFullscreen(); |
| 600 resize_params->display_mode = GetDisplayMode(); |
| 598 } | 601 } |
| 599 | 602 |
| 600 const bool size_changed = | 603 const bool size_changed = |
| 601 !old_resize_params_ || | 604 !old_resize_params_ || |
| 602 old_resize_params_->new_size != resize_params->new_size || | 605 old_resize_params_->new_size != resize_params->new_size || |
| 603 (old_resize_params_->physical_backing_size.IsEmpty() && | 606 (old_resize_params_->physical_backing_size.IsEmpty() && |
| 604 !resize_params->physical_backing_size.IsEmpty()); | 607 !resize_params->physical_backing_size.IsEmpty()); |
| 605 bool dirty = | 608 bool dirty = |
| 606 size_changed || screen_info_out_of_date_ || | 609 size_changed || screen_info_out_of_date_ || |
| 607 old_resize_params_->physical_backing_size != | 610 old_resize_params_->physical_backing_size != |
| 608 resize_params->physical_backing_size || | 611 resize_params->physical_backing_size || |
| 609 old_resize_params_->is_fullscreen != resize_params->is_fullscreen || | 612 old_resize_params_->is_fullscreen != resize_params->is_fullscreen || |
| 613 old_resize_params_->display_mode != resize_params->display_mode || |
| 610 old_resize_params_->top_controls_height != | 614 old_resize_params_->top_controls_height != |
| 611 resize_params->top_controls_height || | 615 resize_params->top_controls_height || |
| 612 old_resize_params_->top_controls_shrink_blink_size != | 616 old_resize_params_->top_controls_shrink_blink_size != |
| 613 resize_params->top_controls_shrink_blink_size || | 617 resize_params->top_controls_shrink_blink_size || |
| 614 old_resize_params_->visible_viewport_size != | 618 old_resize_params_->visible_viewport_size != |
| 615 resize_params->visible_viewport_size; | 619 resize_params->visible_viewport_size; |
| 616 | 620 |
| 617 // We don't expect to receive an ACK when the requested size or the physical | 621 // 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. | 622 // backing size is empty, or when the main viewport size didn't change. |
| 619 resize_params->needs_resize_ack = | 623 resize_params->needs_resize_ack = |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1314 } | 1318 } |
| 1315 | 1319 |
| 1316 bool RenderWidgetHostImpl::IsMouseLocked() const { | 1320 bool RenderWidgetHostImpl::IsMouseLocked() const { |
| 1317 return view_ ? view_->IsMouseLocked() : false; | 1321 return view_ ? view_->IsMouseLocked() : false; |
| 1318 } | 1322 } |
| 1319 | 1323 |
| 1320 bool RenderWidgetHostImpl::IsFullscreen() const { | 1324 bool RenderWidgetHostImpl::IsFullscreen() const { |
| 1321 return false; | 1325 return false; |
| 1322 } | 1326 } |
| 1323 | 1327 |
| 1328 blink::WebDisplayMode RenderWidgetHostImpl::GetDisplayMode() const { |
| 1329 return blink::WebDisplayModeBrowser; |
| 1330 } |
| 1331 |
| 1324 void RenderWidgetHostImpl::SetAutoResize(bool enable, | 1332 void RenderWidgetHostImpl::SetAutoResize(bool enable, |
| 1325 const gfx::Size& min_size, | 1333 const gfx::Size& min_size, |
| 1326 const gfx::Size& max_size) { | 1334 const gfx::Size& max_size) { |
| 1327 auto_resize_enabled_ = enable; | 1335 auto_resize_enabled_ = enable; |
| 1328 min_size_for_auto_resize_ = min_size; | 1336 min_size_for_auto_resize_ = min_size; |
| 1329 max_size_for_auto_resize_ = max_size; | 1337 max_size_for_auto_resize_ = max_size; |
| 1330 } | 1338 } |
| 1331 | 1339 |
| 1332 void RenderWidgetHostImpl::Cleanup() { | 1340 void RenderWidgetHostImpl::Cleanup() { |
| 1333 if (view_) { | 1341 if (view_) { |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 } | 2127 } |
| 2120 #endif | 2128 #endif |
| 2121 | 2129 |
| 2122 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2130 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2123 if (view_) | 2131 if (view_) |
| 2124 return view_->PreferredReadbackFormat(); | 2132 return view_->PreferredReadbackFormat(); |
| 2125 return kN32_SkColorType; | 2133 return kN32_SkColorType; |
| 2126 } | 2134 } |
| 2127 | 2135 |
| 2128 } // namespace content | 2136 } // namespace content |
| OLD | NEW |