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_granted = IsFullscreenGranted(); | 597 resize_params->is_fullscreen_granted = IsFullscreenGranted(); |
| 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_granted != | 610 old_resize_params_->is_fullscreen_granted != |
610 resize_params->is_fullscreen_granted || | 611 resize_params->is_fullscreen_granted || |
| 612 old_resize_params_->display_mode != resize_params->display_mode || |
611 old_resize_params_->top_controls_height != | 613 old_resize_params_->top_controls_height != |
612 resize_params->top_controls_height || | 614 resize_params->top_controls_height || |
613 old_resize_params_->top_controls_shrink_blink_size != | 615 old_resize_params_->top_controls_shrink_blink_size != |
614 resize_params->top_controls_shrink_blink_size || | 616 resize_params->top_controls_shrink_blink_size || |
615 old_resize_params_->visible_viewport_size != | 617 old_resize_params_->visible_viewport_size != |
616 resize_params->visible_viewport_size; | 618 resize_params->visible_viewport_size; |
617 | 619 |
618 // We don't expect to receive an ACK when the requested size or the physical | 620 // We don't expect to receive an ACK when the requested size or the physical |
619 // backing size is empty, or when the main viewport size didn't change. | 621 // backing size is empty, or when the main viewport size didn't change. |
620 resize_params->needs_resize_ack = | 622 resize_params->needs_resize_ack = |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1315 } | 1317 } |
1316 | 1318 |
1317 bool RenderWidgetHostImpl::IsMouseLocked() const { | 1319 bool RenderWidgetHostImpl::IsMouseLocked() const { |
1318 return view_ ? view_->IsMouseLocked() : false; | 1320 return view_ ? view_->IsMouseLocked() : false; |
1319 } | 1321 } |
1320 | 1322 |
1321 bool RenderWidgetHostImpl::IsFullscreenGranted() const { | 1323 bool RenderWidgetHostImpl::IsFullscreenGranted() const { |
1322 return false; | 1324 return false; |
1323 } | 1325 } |
1324 | 1326 |
| 1327 blink::WebDisplayMode RenderWidgetHostImpl::GetDisplayMode() const { |
| 1328 return blink::WebDisplayModeBrowser; |
| 1329 } |
| 1330 |
1325 void RenderWidgetHostImpl::SetAutoResize(bool enable, | 1331 void RenderWidgetHostImpl::SetAutoResize(bool enable, |
1326 const gfx::Size& min_size, | 1332 const gfx::Size& min_size, |
1327 const gfx::Size& max_size) { | 1333 const gfx::Size& max_size) { |
1328 auto_resize_enabled_ = enable; | 1334 auto_resize_enabled_ = enable; |
1329 min_size_for_auto_resize_ = min_size; | 1335 min_size_for_auto_resize_ = min_size; |
1330 max_size_for_auto_resize_ = max_size; | 1336 max_size_for_auto_resize_ = max_size; |
1331 } | 1337 } |
1332 | 1338 |
1333 void RenderWidgetHostImpl::Cleanup() { | 1339 void RenderWidgetHostImpl::Cleanup() { |
1334 if (view_) { | 1340 if (view_) { |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 } | 2126 } |
2121 #endif | 2127 #endif |
2122 | 2128 |
2123 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2129 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
2124 if (view_) | 2130 if (view_) |
2125 return view_->PreferredReadbackFormat(); | 2131 return view_->PreferredReadbackFormat(); |
2126 return kN32_SkColorType; | 2132 return kN32_SkColorType; |
2127 } | 2133 } |
2128 | 2134 |
2129 } // namespace content | 2135 } // namespace content |
OLD | NEW |