Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js |
| index a204b33b377468e65b58095a53ca80e9019cd51a..3f5be33998bc762acd84a55bf3a7cb7b90a704b0 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/emulation/EmulatedDevices.js |
| @@ -133,7 +133,6 @@ WebInspector.EmulatedDevice.fromJSONV1 = function(json) |
| throw new Error("Emulated device has wrong outline insets"); |
| result.outlineImage = /** @type {string} */ (parseValue(json["outline"], "image", "string")); |
| } |
| - |
| return /** @type {!WebInspector.EmulatedDevice.Orientation} */ (result); |
| } |
| @@ -307,6 +306,48 @@ WebInspector.EmulatedDevice.prototype = { |
| }, |
| /** |
| + * @param {!WebInspector.EmulatedDevice.Mode} mode |
| + * @return {string} |
| + */ |
| + outlineImage: function(mode) |
| + { |
| + var orientation = this.orientationByName(mode.orientation); |
| + if (!orientation.outlineImage) |
| + return ""; |
| + if (!this._extension) |
| + return orientation.outlineImage; |
| + return this._extension.module().substituteURL(orientation.outlineImage); |
| + }, |
| + |
| + /** |
| + * @param {!WebInspector.EmulatedDevice.Mode} mode |
| + * @return {?Insets|null} |
|
dgozman
2016/02/09 21:15:10
just ?Insets
mmccoy
2016/02/10 20:06:34
Done.
|
| + */ |
| + outlineInsets: function(mode) |
| + { |
| + var orientation = this.orientationByName(mode.orientation); |
| + if (!orientation.outlineImage) |
| + return null; |
| + return orientation.outlineInsets; |
| + }, |
| + |
| + /** |
| + * @param {!WebInspector.EmulatedDevice.Mode} mode |
| + * @return {?Object|string} |
| + */ |
| + outlineDimensions: function(mode) |
| + { |
| + var orientation = this.orientationByName(mode.orientation); |
| + if (!orientation.outlineImage) |
| + return ""; |
| + var dimensions = { |
| + "width": orientation.width + orientation.outlineInsets.left + orientation.outlineInsets.right, |
| + "height": orientation.height + orientation.outlineInsets.top + orientation.outlineInsets.bottom |
| + } |
| + return dimensions; |
| + }, |
| + |
| + /** |
| * @param {string} name |
| * @return {!WebInspector.EmulatedDevice.Orientation} |
| */ |