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/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4000 params.screen_info.deviceScaleFactor = factor; | 4000 params.screen_info.deviceScaleFactor = factor; |
4001 params.new_size = size(); | 4001 params.new_size = size(); |
4002 params.physical_backing_size = | 4002 params.physical_backing_size = |
4003 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor)); | 4003 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor)); |
4004 params.overdraw_bottom_height = 0.f; | 4004 params.overdraw_bottom_height = 0.f; |
4005 params.resizer_rect = WebRect(); | 4005 params.resizer_rect = WebRect(); |
4006 params.is_fullscreen = is_fullscreen(); | 4006 params.is_fullscreen = is_fullscreen(); |
4007 OnResize(params); | 4007 OnResize(params); |
4008 } | 4008 } |
4009 | 4009 |
| 4010 void RenderViewImpl::SetScreenOrientationForTesting( |
| 4011 const blink::WebScreenOrientationType& orientation) { |
| 4012 ViewMsg_Resize_Params params; |
| 4013 params.screen_info = screen_info_; |
| 4014 params.screen_info.orientationType = orientation; |
| 4015 switch(orientation) { |
| 4016 case blink::WebScreenOrientationLandscapePrimary: |
| 4017 params.screen_info.orientationAngle = 90; |
| 4018 break; |
| 4019 case blink::WebScreenOrientationLandscapeSecondary: |
| 4020 params.screen_info.orientationAngle = -90; |
| 4021 break; |
| 4022 case blink::WebScreenOrientationPortraitSecondary: |
| 4023 params.screen_info.orientationAngle = 180; |
| 4024 break; |
| 4025 default: |
| 4026 params.screen_info.orientationAngle = 0; |
| 4027 } |
| 4028 params.new_size = size(); |
| 4029 params.physical_backing_size = |
| 4030 gfx::ToCeiledSize(gfx::ScaleSize(size(), |
| 4031 params.screen_info.deviceScaleFactor)); |
| 4032 params.overdraw_bottom_height = 0.f; |
| 4033 params.resizer_rect = WebRect(); |
| 4034 params.is_fullscreen = is_fullscreen(); |
| 4035 OnResize(params); |
| 4036 } |
| 4037 |
4010 void RenderViewImpl::SetDeviceColorProfileForTesting( | 4038 void RenderViewImpl::SetDeviceColorProfileForTesting( |
4011 const std::vector<char>& color_profile) { | 4039 const std::vector<char>& color_profile) { |
4012 // TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile). | 4040 // TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile). |
4013 } | 4041 } |
4014 | 4042 |
4015 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { | 4043 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { |
4016 gfx::Rect new_position(rootWindowRect().x, | 4044 gfx::Rect new_position(rootWindowRect().x, |
4017 rootWindowRect().y, | 4045 rootWindowRect().y, |
4018 new_size.width(), | 4046 new_size.width(), |
4019 new_size.height()); | 4047 new_size.height()); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4065 std::vector<gfx::Size> sizes; | 4093 std::vector<gfx::Size> sizes; |
4066 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4094 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
4067 if (!url.isEmpty()) | 4095 if (!url.isEmpty()) |
4068 urls.push_back( | 4096 urls.push_back( |
4069 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4097 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
4070 } | 4098 } |
4071 SendUpdateFaviconURL(urls); | 4099 SendUpdateFaviconURL(urls); |
4072 } | 4100 } |
4073 | 4101 |
4074 } // namespace content | 4102 } // namespace content |
OLD | NEW |