| 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 8bb8ef29612e1c8d404759b09d83a47ba15b8065..83be4ddd1464c71009a295dd90ea824523f69a38 100644
|
| --- a/content/browser/devtools/protocol/emulation_handler.cc
|
| +++ b/content/browser/devtools/protocol/emulation_handler.cc
|
| @@ -151,7 +151,8 @@ Response EmulationHandler::SetDeviceMetricsOverride(
|
| Maybe<int> screen_height,
|
| Maybe<int> position_x,
|
| Maybe<int> position_y,
|
| - Maybe<Emulation::ScreenOrientation> screen_orientation) {
|
| + Maybe<Emulation::ScreenOrientation> screen_orientation,
|
| + Maybe<bool> override_gutter_color) {
|
| const static int max_size = 10000000;
|
| const static double max_scale = 10;
|
| const static int max_orientation_angle = 360;
|
| @@ -188,17 +189,17 @@ Response EmulationHandler::SetDeviceMetricsOverride(
|
| base::DoubleToString(max_scale));
|
| }
|
|
|
| - blink::WebScreenOrientationType orientationType =
|
| + blink::WebScreenOrientationType orientation_type =
|
| blink::kWebScreenOrientationUndefined;
|
| - int orientationAngle = 0;
|
| + int orientation_angle = 0;
|
| if (screen_orientation.isJust()) {
|
| Emulation::ScreenOrientation* orientation = screen_orientation.fromJust();
|
| - orientationType = WebScreenOrientationTypeFromString(
|
| - orientation->GetType());
|
| - if (orientationType == blink::kWebScreenOrientationUndefined)
|
| + orientation_type =
|
| + WebScreenOrientationTypeFromString(orientation->GetType());
|
| + if (orientation_type == blink::kWebScreenOrientationUndefined)
|
| return Response::InvalidParams("Invalid screen orientation type value");
|
| - orientationAngle = orientation->GetAngle();
|
| - if (orientationAngle < 0 || orientationAngle >= max_orientation_angle) {
|
| + orientation_angle = orientation->GetAngle();
|
| + if (orientation_angle < 0 || orientation_angle >= max_orientation_angle) {
|
| return Response::InvalidParams(
|
| "Screen orientation angle must be non-negative, less than " +
|
| base::IntToString(max_orientation_angle));
|
| @@ -216,8 +217,10 @@ Response EmulationHandler::SetDeviceMetricsOverride(
|
| params.view_size = blink::WebSize(width, height);
|
| params.fit_to_view = fit_window;
|
| params.scale = scale.fromMaybe(1);
|
| - params.screen_orientation_type = orientationType;
|
| - params.screen_orientation_angle = orientationAngle;
|
| + params.screen_orientation_type = orientation_type;
|
| + params.screen_orientation_angle = orientation_angle;
|
| + params.override_gutter_color =
|
| + override_gutter_color.fromMaybe(true) && (width || height);
|
|
|
| if (device_emulation_enabled_ && params == device_emulation_params_)
|
| return Response::OK();
|
|
|