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

Unified Diff: chrome/browser/resources/md_history/app.crisper.js

Issue 2257703002: MD History: Improve test helpers, update synced tabs tests to use them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revulcanize Created 4 years, 4 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
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/md_history/app.vulcanized.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.crisper.js
diff --git a/chrome/browser/resources/md_history/app.crisper.js b/chrome/browser/resources/md_history/app.crisper.js
index 3e75862e14094e32974a703a7d4959977c019372..13564d27c06fb4aac553262553bc4e13af51e2f7 100644
--- a/chrome/browser/resources/md_history/app.crisper.js
+++ b/chrome/browser/resources/md_history/app.crisper.js
@@ -7745,6 +7745,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, '');
@@ -14434,7 +14444,9 @@ Polymer({
},
unselectAllItems: function(count) {
- this.getSelectedList_().unselectAllItems(count);
+ var selectedList = this.getSelectedList_();
+ if (selectedList)
+ selectedList.unselectAllItems(count);
},
/**
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/md_history/app.vulcanized.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698