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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2654483004: [DevTools] Provide a way to delete Indexed DBs (Closed)
Patch Set: Moved the confirm dialog Created 3 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 side-by-side diff with in-line comments
Download patch
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));
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698