зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1344372: Add override for RemotePageManager in AboutNewTab.jsm;r=mconley
MozReview-Commit-ID: 9hpJMtagXur --HG-- extra : rebase_source : 2ffe6ffdad1ee61ce49ddd0101436020d649ed52
This commit is contained in:
Родитель
fa37fb63b3
Коммит
1da4448e89
|
@ -24,7 +24,12 @@ var AboutNewTab = {
|
|||
|
||||
pageListener: null,
|
||||
|
||||
isOverridden: false,
|
||||
|
||||
init() {
|
||||
if (this.isOverridden) {
|
||||
return;
|
||||
}
|
||||
this.pageListener = new RemotePages("about:newtab");
|
||||
this.pageListener.addMessageListener("NewTab:Customize", this.customize.bind(this));
|
||||
this.pageListener.addMessageListener("NewTab:MaybeShowAutoMigrationUndoNotification",
|
||||
|
@ -37,7 +42,19 @@ var AboutNewTab = {
|
|||
},
|
||||
|
||||
uninit() {
|
||||
if (this.pageListener) {
|
||||
this.pageListener.destroy();
|
||||
this.pageListener = null;
|
||||
}
|
||||
},
|
||||
|
||||
override() {
|
||||
this.uninit();
|
||||
this.isOverridden = true;
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.isOverridden = false;
|
||||
this.init();
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче