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

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

Issue 2404763002: Refactor overall test suite, use replaceApp in HistoryListTest (Closed)
Patch Set: Fix tests Created 4 years, 1 month 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 | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index c0dbb18a500611cfc0f8a7e112cfe6348a483d02..0b287d535ae590723fb2e1f9422bfe80010d7e95 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -107,13 +107,28 @@ Polymer({
'unselect-all': 'unselectAll',
},
+ /** @private {?function(!Event)} */
+ boundOnCanExecute_: null,
+
+ /** @private {?function(!Event)} */
+ boundOnCommand_: null,
+
/** @override */
- ready: function() {
+ attached: function() {
this.grouped_ = loadTimeData.getBoolean('groupByDomain');
cr.ui.decorate('command', cr.ui.Command);
- document.addEventListener('canExecute', this.onCanExecute_.bind(this));
- document.addEventListener('command', this.onCommand_.bind(this));
+ this.boundOnCanExecute_ = this.onCanExecute_.bind(this);
+ this.boundOnCommand_ = this.onCommand_.bind(this);
+
+ document.addEventListener('canExecute', this.boundOnCanExecute_);
+ document.addEventListener('command', this.boundOnCommand_);
+ },
+
+ /** @override */
+ detached: function() {
+ document.removeEventListener('canExecute', this.boundOnCanExecute_);
+ document.removeEventListener('command', this.boundOnCommand_);
},
onFirstRender: function() {
« no previous file with comments | « no previous file | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698