Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / public / web / WebDeviceEmulationParams.h
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/WebRect.h"
9 #include "public/platform/WebSize.h"
10
11 namespace blink {
12
13 // All sizes are measured in device independent pixels.
14 struct WebDeviceEmulationParams {
15     // 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     enum ScreenPosition {
18         Desktop,
19         Mobile
20     };
21
22     ScreenPosition screenPosition;
23
24     // If zero, the original device scale factor is preserved.
25     float deviceScaleFactor;
26
27     // Emulated view size. Empty size means no override.
28     WebSize viewSize;
29
30     // Whether emulated view should be scaled down if necessary to fit into available space.
31     bool fitToView;
32
33     // Insets of emulated view inside available view space, in fit to view mode.
34     WebSize viewInsets;
35
36     WebDeviceEmulationParams()
37         : screenPosition(Desktop)
38         , deviceScaleFactor(0)
39         , fitToView(false) { }
40 };
41
42 } // namespace blink
43
44 #endif