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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js

Issue 1631223003: [DevTools] Do not use OverridesSupport anywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
OLDNEW
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 /** 5 /**
6 * @constructor 6 * @constructor
7 */ 7 */
8 WebInspector.EmulatedDevice = function() 8 WebInspector.EmulatedDevice = function()
9 { 9 {
10 /** @type {string} */ 10 /** @type {string} */
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 /** 113 /**
114 * @param {*} json 114 * @param {*} json
115 * @return {!WebInspector.EmulatedDevice.Orientation} 115 * @return {!WebInspector.EmulatedDevice.Orientation}
116 */ 116 */
117 function parseOrientation(json) 117 function parseOrientation(json)
118 { 118 {
119 var result = {}; 119 var result = {};
120 120
121 result.width = parseIntValue(json, "width"); 121 result.width = parseIntValue(json, "width");
122 if (result.width < 0 || result.width > WebInspector.OverridesSupport .MaxDeviceSize) 122 if (result.width < 0 || result.width > WebInspector.DeviceModeModel. MaxDeviceSize || result.width < WebInspector.DeviceModeModel.MinDeviceSize)
123 throw new Error("Emulated device has wrong width: " + result.wid th); 123 throw new Error("Emulated device has wrong width: " + result.wid th);
124 124
125 result.height = parseIntValue(json, "height"); 125 result.height = parseIntValue(json, "height");
126 if (result.height < 0 || result.height > WebInspector.OverridesSuppo rt.MaxDeviceSize) 126 if (result.height < 0 || result.height > WebInspector.DeviceModeMode l.MaxDeviceSize || result.height < WebInspector.DeviceModeModel.MinDeviceSize)
127 throw new Error("Emulated device has wrong height: " + result.he ight); 127 throw new Error("Emulated device has wrong height: " + result.he ight);
128 128
129 var outlineInsets = parseValue(json["outline"], "insets", "object", null); 129 var outlineInsets = parseValue(json["outline"], "insets", "object", null);
130 if (outlineInsets) { 130 if (outlineInsets) {
131 result.outlineInsets = parseInsets(outlineInsets); 131 result.outlineInsets = parseInsets(outlineInsets);
132 if (result.outlineInsets.left < 0 || result.outlineInsets.top < 0) 132 if (result.outlineInsets.left < 0 || result.outlineInsets.top < 0)
133 throw new Error("Emulated device has wrong outline insets"); 133 throw new Error("Emulated device has wrong outline insets");
134 result.outlineImage = /** @type {string} */ (parseValue(json["ou tline"], "image", "string")); 134 result.outlineImage = /** @type {string} */ (parseValue(json["ou tline"], "image", "string"));
135 } 135 }
136 136
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 if (deviceById.has(title)) 532 if (deviceById.has(title))
533 to[i].copyShowFrom(/** @type {!WebInspector.EmulatedDevice} */ ( deviceById.get(title))); 533 to[i].copyShowFrom(/** @type {!WebInspector.EmulatedDevice} */ ( deviceById.get(title)));
534 } 534 }
535 }, 535 },
536 536
537 __proto__: WebInspector.Object.prototype 537 __proto__: WebInspector.Object.prototype
538 } 538 }
539 539
540 /** @type {!WebInspector.EmulatedDevicesList} */ 540 /** @type {!WebInspector.EmulatedDevicesList} */
541 WebInspector.emulatedDevicesList; 541 WebInspector.emulatedDevicesList;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698