| 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 "public/platform/WebFloatPoint.h" |
| 8 #include "public/platform/WebRect.h" | 9 #include "public/platform/WebRect.h" |
| 9 #include "public/platform/WebSize.h" | 10 #include "public/platform/WebSize.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 // All sizes are measured in device independent pixels. | 14 // All sizes are measured in device independent pixels. |
| 14 struct WebDeviceEmulationParams { | 15 struct WebDeviceEmulationParams { |
| 15 // For mobile, screen has the same size as view, which is positioned at (0;0
). | 16 // For mobile, screen has the same size as view, which is positioned at (0;0
). |
| 16 // For desktop, screen size and view position are preserved. | 17 // For desktop, screen size and view position are preserved. |
| 17 enum ScreenPosition { | 18 enum ScreenPosition { |
| 18 Desktop, | 19 Desktop, |
| 19 Mobile | 20 Mobile |
| 20 }; | 21 }; |
| 21 | 22 |
| 22 ScreenPosition screenPosition; | 23 ScreenPosition screenPosition; |
| 23 | 24 |
| 24 // If zero, the original device scale factor is preserved. | 25 // If zero, the original device scale factor is preserved. |
| 25 float deviceScaleFactor; | 26 float deviceScaleFactor; |
| 26 | 27 |
| 27 // Emulated view size. Empty size means no override. | 28 // Emulated view size. Empty size means no override. |
| 28 WebSize viewSize; | 29 WebSize viewSize; |
| 29 | 30 |
| 30 // Whether emulated view should be scaled down if necessary to fit into avai
lable space. | 31 // Whether emulated view should be scaled down if necessary to fit into avai
lable space. |
| 31 bool fitToView; | 32 bool fitToView; |
| 32 | 33 |
| 33 // Insets of emulated view inside available view space, in fit to view mode. | 34 // Insets of emulated view inside available view space, in fit to view mode. |
| 34 WebSize viewInsets; | 35 WebSize viewInsets; |
| 35 | 36 |
| 37 // Offset of emulated view inside available space, not in fit to view mode. |
| 38 WebFloatPoint offset; |
| 39 |
| 40 // Scale of emulated view inside available space, not in fit to view mode. |
| 41 float scale; |
| 42 |
| 36 WebDeviceEmulationParams() | 43 WebDeviceEmulationParams() |
| 37 : screenPosition(Desktop) | 44 : screenPosition(Desktop) |
| 38 , deviceScaleFactor(0) | 45 , deviceScaleFactor(0) |
| 39 , fitToView(false) { } | 46 , fitToView(false) |
| 47 , scale(1) { } |
| 40 }; | 48 }; |
| 41 | 49 |
| 42 } // namespace blink | 50 } // namespace blink |
| 43 | 51 |
| 44 #endif | 52 #endif |
| OLD | NEW |