| 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() {
|
|
|