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

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

Issue 339913002: Move MockScreenOrientationController to content/shell/renderer/test_runner/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix layer violation Created 6 years, 5 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 | Annotate | Revision Log
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 3907 matching lines...) Expand 10 before | Expand all | Expand 10 after
3918 params.screen_info.deviceScaleFactor = factor; 3918 params.screen_info.deviceScaleFactor = factor;
3919 params.new_size = size(); 3919 params.new_size = size();
3920 params.physical_backing_size = 3920 params.physical_backing_size =
3921 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor)); 3921 gfx::ToCeiledSize(gfx::ScaleSize(size(), factor));
3922 params.overdraw_bottom_height = 0.f; 3922 params.overdraw_bottom_height = 0.f;
3923 params.resizer_rect = WebRect(); 3923 params.resizer_rect = WebRect();
3924 params.is_fullscreen = is_fullscreen(); 3924 params.is_fullscreen = is_fullscreen();
3925 OnResize(params); 3925 OnResize(params);
3926 } 3926 }
3927 3927
3928 void RenderViewImpl::SetScreenOrientationForTesting(
3929 const blink::WebScreenOrientationType& orientation) {
3930 ViewMsg_Resize_Params params;
3931 params.screen_info = screen_info_;
3932 params.screen_info.orientationType = orientation;
3933 // FIXME(ostap): This relationship between orientationType and
3934 // orientationAngle is temporary. The test should be able to specify
3935 // the angle in addition to the orientation type.
3936 switch (orientation) {
3937 case blink::WebScreenOrientationLandscapePrimary:
3938 params.screen_info.orientationAngle = 90;
3939 break;
3940 case blink::WebScreenOrientationLandscapeSecondary:
3941 params.screen_info.orientationAngle = -90;
3942 break;
3943 case blink::WebScreenOrientationPortraitSecondary:
3944 params.screen_info.orientationAngle = 180;
3945 break;
3946 default:
3947 params.screen_info.orientationAngle = 0;
3948 }
3949 params.new_size = size();
3950 params.physical_backing_size = gfx::ToCeiledSize(
3951 gfx::ScaleSize(size(), params.screen_info.deviceScaleFactor));
3952 params.overdraw_bottom_height = 0.f;
3953 params.resizer_rect = WebRect();
3954 params.is_fullscreen = is_fullscreen();
3955 OnResize(params);
3956 }
3957
3958 void RenderViewImpl::SetDeviceColorProfileForTesting( 3928 void RenderViewImpl::SetDeviceColorProfileForTesting(
3959 const std::vector<char>& color_profile) { 3929 const std::vector<char>& color_profile) {
3960 SetDeviceColorProfile(color_profile); 3930 SetDeviceColorProfile(color_profile);
3961 } 3931 }
3962 3932
3963 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) { 3933 void RenderViewImpl::ForceResizeForTesting(const gfx::Size& new_size) {
3964 gfx::Rect new_position(rootWindowRect().x, 3934 gfx::Rect new_position(rootWindowRect().x,
3965 rootWindowRect().y, 3935 rootWindowRect().y,
3966 new_size.width(), 3936 new_size.width(),
3967 new_size.height()); 3937 new_size.height());
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
4013 std::vector<gfx::Size> sizes; 3983 std::vector<gfx::Size> sizes;
4014 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 3984 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4015 if (!url.isEmpty()) 3985 if (!url.isEmpty())
4016 urls.push_back( 3986 urls.push_back(
4017 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 3987 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4018 } 3988 }
4019 SendUpdateFaviconURL(urls); 3989 SendUpdateFaviconURL(urls);
4020 } 3990 }
4021 3991
4022 } // namespace content 3992 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698