Chromium Code Reviews| 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; | |
|
mlamouri (slow - plz ping)
2014/05/15 07:06:59
Please, do not do that kind of assumptions. It see
Inactive
2014/05/15 13:01:47
I agree we generally shouldn't make this kind of a
| |
| 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 = gfx::ToCeiledSize( | |
| 4030 gfx::ScaleSize(size(), params.screen_info.deviceScaleFactor)); | |
| 4031 params.overdraw_bottom_height = 0.f; | |
| 4032 params.resizer_rect = WebRect(); | |
| 4033 params.is_fullscreen = is_fullscreen(); | |
| 4034 OnResize(params); | |
| 4035 } | |
| 4036 | |
| 4010 void RenderViewImpl::SetDeviceColorProfileForTesting( | 4037 void RenderViewImpl::SetDeviceColorProfileForTesting( |
| 4011 const std::vector<char>& color_profile) { | 4038 const std::vector<char>& color_profile) { |
| 4012 // TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile). | 4039 // TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile). |
| 4013 } | 4040 } |
| 4014 | 4041 |
| 4015 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { | 4042 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { |
| 4016 gfx::Rect new_position(rootWindowRect().x, | 4043 gfx::Rect new_position(rootWindowRect().x, |
| 4017 rootWindowRect().y, | 4044 rootWindowRect().y, |
| 4018 new_size.width(), | 4045 new_size.width(), |
| 4019 new_size.height()); | 4046 new_size.height()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4065 std::vector<gfx::Size> sizes; | 4092 std::vector<gfx::Size> sizes; |
| 4066 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); | 4093 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); |
| 4067 if (!url.isEmpty()) | 4094 if (!url.isEmpty()) |
| 4068 urls.push_back( | 4095 urls.push_back( |
| 4069 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); | 4096 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); |
| 4070 } | 4097 } |
| 4071 SendUpdateFaviconURL(urls); | 4098 SendUpdateFaviconURL(urls); |
| 4072 } | 4099 } |
| 4073 | 4100 |
| 4074 } // namespace content | 4101 } // namespace content |
| OLD | NEW |