Commit 6ac9cab0 authored by dgozman@chromium.org's avatar dgozman@chromium.org

[DevTools] Introduced WebDeviceEmulationParams.

BUG=327641
TBR=pfeldman@chromium.org

Review URL: https://codereview.chromium.org/222173002

git-svn-id: svn://svn.chromium.org/blink/trunk@170670 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 34a3f21c
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
namespace blink { namespace blink {
class WebString; class WebString;
struct WebDeviceEmulationParams;
struct WebDevToolsMessageData; struct WebDevToolsMessageData;
struct WebRect; struct WebRect;
struct WebSize; struct WebSize;
...@@ -99,6 +100,9 @@ public: ...@@ -99,6 +100,9 @@ public:
const WebRect& screenRect, const WebRect& viewRect, const WebRect& screenRect, const WebRect& viewRect,
float deviceScaleFactor, bool fitToView) { } float deviceScaleFactor, bool fitToView) { }
// Enables device emulation as specified in params.
virtual void enableDeviceEmulation(const WebDeviceEmulationParams& params) { }
// Cancel emulation started via |enableDeviceEmulation| call. // Cancel emulation started via |enableDeviceEmulation| call.
virtual void disableDeviceEmulation() { } virtual void disableDeviceEmulation() { }
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WebDeviceEmulationParams_h
#define WebDeviceEmulationParams_h
#include "public/platform/WebRect.h"
#include "public/platform/WebSize.h"
namespace blink {
// All sizes are measured in device independent pixels.
struct WebDeviceEmulationParams {
// For mobile, screen has the same size as view, which is positioned at (0;0).
// For desktop, screen size and view position are preserved.
enum ScreenPosition {
Desktop,
Mobile
};
ScreenPosition screenPosition;
// If zero, the original device scale factor is preserved.
float deviceScaleFactor;
// Emulated view size. Empty size means no override.
WebSize viewSize;
// Whether emulated view should be scaled down if necessary to fit into available space.
bool fitToView;
// Insets of emulated view inside available view space, in fit to view mode.
WebSize viewInsets;
WebDeviceEmulationParams()
: screenPosition(Desktop)
, deviceScaleFactor(0)
, fitToView(false) { }
};
} // namespace blink
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment