Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: public/web/WebDeviceEmulationParams.h

Issue 1202523003: [DevTools] Add screen size and position to WebDeviceEmulationParams. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebDeviceEmulationParams.h
diff --git a/public/web/WebDeviceEmulationParams.h b/public/web/WebDeviceEmulationParams.h
index a55872ba8482621572a53deccb060fdd5f165cdb..c1e8f4ca842e2a4edacfe7949092d9ca2acdaf37 100644
--- a/public/web/WebDeviceEmulationParams.h
+++ b/public/web/WebDeviceEmulationParams.h
@@ -6,6 +6,7 @@
#define WebDeviceEmulationParams_h
#include "../platform/WebFloatPoint.h"
+#include "../platform/WebPoint.h"
#include "../platform/WebRect.h"
#include "../platform/WebSize.h"
@@ -13,7 +14,7 @@ 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 mobile, |screenSize| and |viewPosition| are used.
// For desktop, screen size and view position are preserved.
enum ScreenPosition {
Desktop,
@@ -23,6 +24,12 @@ struct WebDeviceEmulationParams {
ScreenPosition screenPosition;
+ // Emulated screen size. Used with |screenPosition == Mobile|.
+ WebSize screenSize;
+
+ // Position of view on the screen. Used with |screenPosition == Mobile|.
+ WebPoint viewPosition;
+
// If zero, the original device scale factor is preserved.
float deviceScaleFactor;
@@ -47,7 +54,7 @@ struct WebDeviceEmulationParams {
inline bool operator==(const WebDeviceEmulationParams& a, const WebDeviceEmulationParams& b)
{
- return a.screenPosition == b.screenPosition && a.deviceScaleFactor == b.deviceScaleFactor && a.viewSize == b.viewSize && a.fitToView == b.fitToView && a.offset == b.offset && a.scale == b.scale;
+ return a.screenPosition == b.screenPosition && a.screenSize == b.screenSize && a.viewPosition == b.viewPosition && a.deviceScaleFactor == b.deviceScaleFactor && a.viewSize == b.viewSize && a.fitToView == b.fitToView && a.offset == b.offset && a.scale == b.scale;
}
inline bool operator!=(const WebDeviceEmulationParams& a, const WebDeviceEmulationParams& b)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698