Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 284583003: Use WebScreenInfo members to provide screen orientation information for layout test support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after
3998 params.screen_info.deviceScaleFactor = factor; 3998 params.screen_info.deviceScaleFactor = factor;
3999 params.new_size = size(); 3999 params.new_size = size();
4000 params.physical_backing_size = 4000 params.physical_backing_size =
4001 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor)); 4001 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor));
4002 params.overdraw_bottom_height = 0.f; 4002 params.overdraw_bottom_height = 0.f;
4003 params.resizer_rect = WebRect(); 4003 params.resizer_rect = WebRect();
4004 params.is_fullscreen = is_fullscreen(); 4004 params.is_fullscreen = is_fullscreen();
4005 OnResize(params); 4005 OnResize(params);
4006 } 4006 }
4007 4007
4008 void RenderViewImpl::SetScreenOrientationForTesting(
4009 const blink::WebScreenOrientationType& orientation) {
4010 ViewMsg_Resize_Params params;
4011 params.screen_info = screen_info_;
4012 params.screen_info.orientationType = orientation;
4013 // FIXME(ostap): This relationship between orientationType and
4014 // orientationAngle is temporary. The test should be able to specify
4015 // the angle in addition to the orientation type.
4016 switch (orientation) {
4017 case blink::WebScreenOrientationLandscapePrimary:
4018 params.screen_info.orientationAngle = 90;
4019 break;
4020 case blink::WebScreenOrientationLandscapeSecondary:
4021 params.screen_info.orientationAngle = -90;
4022 break;
4023 case blink::WebScreenOrientationPortraitSecondary:
4024 params.screen_info.orientationAngle = 180;
4025 break;
4026 default:
4027 params.screen_info.orientationAngle = 0;
4028 }
4029 params.new_size = size();
4030 params.physical_backing_size = gfx::ToCeiledSize(
4031 gfx::ScaleSize(size(), 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
4008 void RenderViewImpl::SetDeviceColorProfileForTesting( 4038 void RenderViewImpl::SetDeviceColorProfileForTesting(
4009 const std::vector<char>& color_profile) { 4039 const std::vector<char>& color_profile) {
4010 // TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile). 4040 // TODO(noel): Add RenderViewImpl::SetDeviceColorProfile(color_profile).
4011 } 4041 }
4012 4042
4013 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { 4043 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) {
4014 gfx::Rect new_position(rootWindowRect().x, 4044 gfx::Rect new_position(rootWindowRect().x,
4015 rootWindowRect().y, 4045 rootWindowRect().y,
4016 new_size.width(), 4046 new_size.width(),
4017 new_size.height()); 4047 new_size.height());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
4063 std::vector<gfx::Size> sizes; 4093 std::vector<gfx::Size> sizes;
4064 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4094 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4065 if (!url.isEmpty()) 4095 if (!url.isEmpty())
4066 urls.push_back( 4096 urls.push_back(
4067 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4097 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4068 } 4098 }
4069 SendUpdateFaviconURL(urls); 4099 SendUpdateFaviconURL(urls);
4070 } 4100 }
4071 4101
4072 } // namespace content 4102 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/shell/renderer/webkit_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698