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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Scale of emulated view inside available space, not in fit to view mode. | 46 // Scale of emulated view inside available space, not in fit to view mode. |
47 float scale; | 47 float scale; |
48 | 48 |
49 // Optional screen orientation type, with WebScreenOrientationUndefined | 49 // Optional screen orientation type, with WebScreenOrientationUndefined |
50 // value meaning no emulation necessary. | 50 // value meaning no emulation necessary. |
51 WebScreenOrientationType screenOrientationType; | 51 WebScreenOrientationType screenOrientationType; |
52 | 52 |
53 // Screen orientation angle, used together with screenOrientationType. | 53 // Screen orientation angle, used together with screenOrientationType. |
54 int screenOrientationAngle; | 54 int screenOrientationAngle; |
55 | 55 |
| 56 // Scroll position of outer viewport (frame). |x < 0| or |y < 0| disables |
| 57 // the override for the respective coordinate. |
| 58 WebPoint scrollPosition; |
| 59 |
| 60 // Emulated visible view size. |x < 0| or |y < 0| disables the override for |
| 61 // the respective coordinate. |
| 62 WebSize visualViewportSize; |
| 63 |
| 64 // Scroll position of inner (visual) viewport. |x < 0| or |y < 0| disables |
| 65 // the override for the respective coordinate. |
| 66 WebFloatPoint visualViewportPosition; |
| 67 |
| 68 // Pinch-zoom scale of inner (visual) viewport. |visualViewportScale == 0| |
| 69 // disables the override. |
| 70 double visualViewportScale; |
| 71 |
56 WebDeviceEmulationParams() | 72 WebDeviceEmulationParams() |
57 : screenPosition(Desktop) | 73 : screenPosition(Desktop) |
58 , deviceScaleFactor(0) | 74 , deviceScaleFactor(0) |
59 , fitToView(false) | 75 , fitToView(false) |
60 , scale(1) | 76 , scale(1) |
61 , screenOrientationType(WebScreenOrientationUndefined) | 77 , screenOrientationType(WebScreenOrientationUndefined) |
62 , screenOrientationAngle(0) { } | 78 , screenOrientationAngle(0) |
| 79 , visualViewportScale(0) { } |
63 }; | 80 }; |
64 | 81 |
65 inline bool operator==(const WebDeviceEmulationParams& a, const WebDeviceEmulati
onParams& b) | 82 inline bool operator==(const WebDeviceEmulationParams& a, const WebDeviceEmulati
onParams& b) |
66 { | 83 { |
67 return a.screenPosition == b.screenPosition && a.screenSize == b.screenSize
&& a.viewPosition == b.viewPosition && a.deviceScaleFactor == b.deviceScaleFacto
r | 84 return a.screenPosition == b.screenPosition && a.screenSize == b.screenSize
&& a.viewPosition == b.viewPosition && a.deviceScaleFactor == b.deviceScaleFacto
r |
68 && a.viewSize == b.viewSize && a.fitToView == b.fitToView && a.offset ==
b.offset && a.scale == b.scale | 85 && a.viewSize == b.viewSize && a.fitToView == b.fitToView && a.offset ==
b.offset && a.scale == b.scale |
69 && a.screenOrientationType == b.screenOrientationType && a.screenOrienta
tionAngle == b.screenOrientationAngle; | 86 && a.screenOrientationType == b.screenOrientationType && a.screenOrienta
tionAngle == b.screenOrientationAngle && a.scrollPosition == b.scrollPosition |
| 87 && a.visualViewportSize == b.visualViewportSize && a.visualViewportPosit
ion == b.visualViewportPosition && a.visualViewportScale == b.visualViewportScal
e; |
70 } | 88 } |
71 | 89 |
72 inline bool operator!=(const WebDeviceEmulationParams& a, const WebDeviceEmulati
onParams& b) | 90 inline bool operator!=(const WebDeviceEmulationParams& a, const WebDeviceEmulati
onParams& b) |
73 { | 91 { |
74 return !(a == b); | 92 return !(a == b); |
75 } | 93 } |
76 | 94 |
77 } // namespace blink | 95 } // namespace blink |
78 | 96 |
79 #endif | 97 #endif |
OLD | NEW |