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

Unified Diff: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js

Issue 2180823004: Migrate <cr-dialog> from PaperDialogBehavior to native <dialog>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
index 9c9d73fdb7eeaf95bb10574131a0d56d354a5b8b..ea6a348508174d6e884b7be986e9ca0b7c617e9f 100644
--- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
+++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
@@ -3,44 +3,19 @@
// found in the LICENSE file.
/**
- * @fileoverview 'cr-dialog' is a component for showing a modal dialog.
+ * @fileoverview 'cr-dialog' is a component for showing a modal dialog. If the
+ * dialog is closed via close(), a 'close' event is fired. If the dialog is
+ * canceled via cancel(), a 'cancel' event is fired followed by a 'close' event.
*/
Polymer({
is: 'cr-dialog',
+ extends: 'dialog',
- properties: {
- /** @override */
- noCancelOnOutsideClick: {
- type: Boolean,
- value: true,
- },
-
- /** @override */
- noCancelOnEscKey: {
- type: Boolean,
- value: false,
- },
-
- /**
- * @type {!Element}
- * @override
- */
- sizingTarget: {
- type: Element,
- value: function() {
- return assert(this.$$('.body-container'));
- },
- },
-
- /** @override */
- withBackdrop: {
- type: Boolean,
- value: true,
- },
+ cancel: function() {
+ this.fire('cancel');
+ HTMLDialogElement.prototype.close.call(this, /* wasCanceled */ 'true');
},
- behaviors: [Polymer.PaperDialogBehavior],
-
/** @return {!PaperIconButtonElement} */
getCloseButton: function() {
return this.$.close;

Powered by Google App Engine
This is Rietveld 408576698