| 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 5deb50cdea1c893c1fb7a77c852029fbd5397bd3..fc13095d5eec9c815c1c54e713b4f6206a0a0f11 100644
|
| --- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
|
| +++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.js
|
| @@ -15,6 +15,16 @@ Polymer({
|
| is: 'cr-dialog',
|
| extends: 'dialog',
|
|
|
| + /** @override */
|
| + created: function() {
|
| + // If the active history entry changes (i.e. user clicks back button),
|
| + // all open dialogs should be cancelled.
|
| + window.addEventListener('popstate', function() {
|
| + if (this.open)
|
| + this.cancel();
|
| + }.bind(this));
|
| + },
|
| +
|
| cancel: function() {
|
| this.fire('cancel');
|
| HTMLDialogElement.prototype.close.call(this, '');
|
|
|