| Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| index ef8aed6389eba681045fa65787b2f186f404147a..237f506419a894f7c13cc5af05f3326e9f4ccb6c 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
|
| @@ -2038,3 +2038,43 @@ UI.createFileSelectorElement = function(callback) {
|
| * @type {number}
|
| */
|
| UI.MaxLengthForDisplayedURLs = 150;
|
| +
|
| +/**
|
| + * @unrestricted
|
| + */
|
| +UI.ConfirmDialog = class extends UI.VBox {
|
| + /**
|
| + * @param {string} message
|
| + * @param {!Function} callback
|
| + */
|
| + static show(message, callback) {
|
| + var dialog = new UI.Dialog();
|
| + dialog.setWrapsContent(true);
|
| + dialog.addCloseButton();
|
| + dialog.setDimmed(true);
|
| + new UI
|
| + .ConfirmDialog(
|
| + message,
|
| + () => {
|
| + dialog.detach();
|
| + callback();
|
| + },
|
| + () => dialog.detach())
|
| + .show(dialog.element);
|
| + dialog.show();
|
| + }
|
| +
|
| + /**
|
| + * @param {string} message
|
| + * @param {!Function} okCallback
|
| + * @param {!Function} cancelCallback
|
| + */
|
| + constructor(message, okCallback, cancelCallback) {
|
| + super(true);
|
| + this.registerRequiredCSS('ui/confirmDialog.css');
|
| + this.contentElement.createChild('div', 'message').createChild('span').textContent = message;
|
| + var buttonsBar = this.contentElement.createChild('div', 'button');
|
| + buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback));
|
| + buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancelCallback));
|
| + }
|
| +};
|
|
|