| Index: third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| index fb24054e2b1d37c9310d8bb171060efd496cb07c..dda2f68041abcedc3f5136dfc8828851b4b2f6b5 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
|
| @@ -105,6 +105,16 @@ WebInspector.Dialog.prototype = {
|
| },
|
|
|
| /**
|
| + * @param {number=} positionX
|
| + * @param {number=} positionY
|
| + */
|
| + setPosition: function(positionX, positionY)
|
| + {
|
| + this._defaultPositionX = positionX;
|
| + this._defaultPositionY = positionY;
|
| + },
|
| +
|
| + /**
|
| * @param {!Size} size
|
| */
|
| setMaxSize: function(size)
|
| @@ -194,11 +204,21 @@ WebInspector.Dialog.prototype = {
|
| height = Math.min(height, this._maxSize.height);
|
| }
|
|
|
| - var positionX = (container.offsetWidth - width) / 2;
|
| - positionX = Number.constrain(positionX, 0, container.offsetWidth - width);
|
| + var positionX;
|
| + if (typeof this._defaultPositionX === "number") {
|
| + positionX = this._defaultPositionX;
|
| + } else {
|
| + positionX = (container.offsetWidth - width) / 2;
|
| + positionX = Number.constrain(positionX, 0, container.offsetWidth - width);
|
| + }
|
|
|
| - var positionY = (container.offsetHeight - height) / 2;
|
| - positionY = Number.constrain(positionY, 0, container.offsetHeight - height);
|
| + var positionY;
|
| + if (typeof this._defaultPositionY === "number") {
|
| + positionY = this._defaultPositionY;
|
| + } else {
|
| + positionY = (container.offsetHeight - height) / 2;
|
| + positionY = Number.constrain(positionY, 0, container.offsetHeight - height);
|
| + }
|
|
|
| this.element.style.width = width + "px";
|
| this.element.style.height = height + "px";
|
|
|