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