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

Unified Diff: content/browser/devtools/protocol/emulation_handler.cc

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove offset/scale params, rename commands, clip by backing size. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/devtools/protocol/emulation_handler.cc
diff --git a/content/browser/devtools/protocol/emulation_handler.cc b/content/browser/devtools/protocol/emulation_handler.cc
index aa0d798a4336d7408220b2a0aff252774ae86c21..4d5971965a3805e89e39e7fa3b122d2381f8ec86 100644
--- a/content/browser/devtools/protocol/emulation_handler.cc
+++ b/content/browser/devtools/protocol/emulation_handler.cc
@@ -151,7 +151,6 @@ Response EmulationHandler::SetDeviceMetricsOverride(
const int* position_y,
const std::unique_ptr<base::DictionaryValue>& screen_orientation) {
const static int max_size = 10000000;
- const static double max_scale = 10;
const static int max_orientation_angle = 360;
if (!host_)
@@ -180,12 +179,6 @@ Response EmulationHandler::SetDeviceMetricsOverride(
if (device_scale_factor < 0)
return Response::InvalidParams("deviceScaleFactor must be non-negative");
- if (optional_scale && (*optional_scale <= 0 || *optional_scale > max_scale)) {
- return Response::InvalidParams(
- "scale must be positive, not greater than " +
- base::DoubleToString(max_scale));
- }
-
blink::WebScreenOrientationType orientationType =
blink::WebScreenOrientationUndefined;
int orientationAngle = 0;
@@ -220,10 +213,6 @@ Response EmulationHandler::SetDeviceMetricsOverride(
params.deviceScaleFactor = device_scale_factor;
params.viewSize = blink::WebSize(width, height);
params.fitToView = fit_window;
- params.scale = optional_scale ? *optional_scale : 1;
- params.offset = blink::WebFloatPoint(
- optional_offset_x ? *optional_offset_x : 0.f,
- optional_offset_y ? *optional_offset_y : 0.f);
params.screenOrientationType = orientationType;
params.screenOrientationAngle = orientationAngle;

Powered by Google App Engine
This is Rietveld 408576698