| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef WebDeviceEmulationParams_h | 5 #ifndef WebDeviceEmulationParams_h |
| 6 #define WebDeviceEmulationParams_h | 6 #define WebDeviceEmulationParams_h |
| 7 | 7 |
| 8 #include "../platform/WebFloatPoint.h" | 8 #include "../platform/WebFloatPoint.h" |
| 9 #include "../platform/WebPoint.h" | 9 #include "../platform/WebPoint.h" |
| 10 #include "../platform/WebRect.h" | 10 #include "../platform/WebRect.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Scale of emulated view inside available space, not in fit to view mode. | 43 // Scale of emulated view inside available space, not in fit to view mode. |
| 44 float scale; | 44 float scale; |
| 45 | 45 |
| 46 // Optional screen orientation type, with WebScreenOrientationUndefined | 46 // Optional screen orientation type, with WebScreenOrientationUndefined |
| 47 // value meaning no emulation necessary. | 47 // value meaning no emulation necessary. |
| 48 WebScreenOrientationType screen_orientation_type; | 48 WebScreenOrientationType screen_orientation_type; |
| 49 | 49 |
| 50 // Screen orientation angle, used together with screenOrientationType. | 50 // Screen orientation angle, used together with screenOrientationType. |
| 51 int screen_orientation_angle; | 51 int screen_orientation_angle; |
| 52 | 52 |
| 53 // Whether to override the gutter color to a dark gray. If enabled, this will |
| 54 // affect the rendering of pages if the page does not set a background color. |
| 55 bool override_gutter_color; |
| 56 |
| 53 WebDeviceEmulationParams() | 57 WebDeviceEmulationParams() |
| 54 : screen_position(kDesktop), | 58 : screen_position(kDesktop), |
| 55 device_scale_factor(0), | 59 device_scale_factor(0), |
| 56 fit_to_view(false), | 60 fit_to_view(false), |
| 57 scale(1), | 61 scale(1), |
| 58 screen_orientation_type(kWebScreenOrientationUndefined), | 62 screen_orientation_type(kWebScreenOrientationUndefined), |
| 59 screen_orientation_angle(0) {} | 63 screen_orientation_angle(0), |
| 64 override_gutter_color(true) {} |
| 60 }; | 65 }; |
| 61 | 66 |
| 62 inline bool operator==(const WebDeviceEmulationParams& a, | 67 inline bool operator==(const WebDeviceEmulationParams& a, |
| 63 const WebDeviceEmulationParams& b) { | 68 const WebDeviceEmulationParams& b) { |
| 64 return a.screen_position == b.screen_position && | 69 return a.screen_position == b.screen_position && |
| 65 a.screen_size == b.screen_size && a.view_position == b.view_position && | 70 a.screen_size == b.screen_size && a.view_position == b.view_position && |
| 66 a.device_scale_factor == b.device_scale_factor && | 71 a.device_scale_factor == b.device_scale_factor && |
| 67 a.view_size == b.view_size && a.fit_to_view == b.fit_to_view && | 72 a.view_size == b.view_size && a.fit_to_view == b.fit_to_view && |
| 68 a.offset == b.offset && a.scale == b.scale && | 73 a.offset == b.offset && a.scale == b.scale && |
| 69 a.screen_orientation_type == b.screen_orientation_type && | 74 a.screen_orientation_type == b.screen_orientation_type && |
| 70 a.screen_orientation_angle == b.screen_orientation_angle; | 75 a.screen_orientation_angle == b.screen_orientation_angle && |
| 76 a.override_gutter_color == b.override_gutter_color; |
| 71 } | 77 } |
| 72 | 78 |
| 73 inline bool operator!=(const WebDeviceEmulationParams& a, | 79 inline bool operator!=(const WebDeviceEmulationParams& a, |
| 74 const WebDeviceEmulationParams& b) { | 80 const WebDeviceEmulationParams& b) { |
| 75 return !(a == b); | 81 return !(a == b); |
| 76 } | 82 } |
| 77 | 83 |
| 78 } // namespace blink | 84 } // namespace blink |
| 79 | 85 |
| 80 #endif | 86 #endif |
| OLD | NEW |