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

Unified Diff: ui/webui/resources/js/cr/ui/page_manager/page_manager.js

Issue 514503002: Clean up cr.ui.pageManager.Page prototype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 | « ui/webui/resources/js/cr/ui/page_manager/page.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/page_manager/page_manager.js
diff --git a/ui/webui/resources/js/cr/ui/page_manager/page_manager.js b/ui/webui/resources/js/cr/ui/page_manager/page_manager.js
index a504c907bf80dc2dbe519c7d3f6fbabfb01803f3..559b1f4ee5795da55057c828ce37ddc6aacaab94 100644
--- a/ui/webui/resources/js/cr/ui/page_manager/page_manager.js
+++ b/ui/webui/resources/js/cr/ui/page_manager/page_manager.js
@@ -185,10 +185,8 @@ cr.define('cr.ui.pageManager', function() {
// Notify pages if they will be hidden.
this.forEachPage_(!isRootPageLocked, function(page) {
- if (page.willHidePage && page.name != pageName &&
- !this.isAncestorOfPage(page, targetPage)) {
+ if (page.name != pageName && !this.isAncestorOfPage(page, targetPage))
page.willHidePage();
- }
});
// Update the page's hash.
@@ -213,7 +211,7 @@ cr.define('cr.ui.pageManager', function() {
// Notify pages if they were shown.
this.forEachPage_(!isRootPageLocked, function(page) {
- if (!targetPageWasVisible && page.didShowPage &&
+ if (!targetPageWasVisible &&
(page.name == pageName ||
this.isAncestorOfPage(page, targetPage))) {
page.didShowPage();
@@ -333,9 +331,8 @@ cr.define('cr.ui.pageManager', function() {
return;
overlay.visible = false;
+ overlay.didClosePage();
- if (overlay.didClosePage)
- overlay.didClosePage();
this.updateHistoryState_(false);
this.updateTitle_();
@@ -422,7 +419,7 @@ cr.define('cr.ui.pageManager', function() {
this.defaultPage_;
if (currentOverlay && !this.isAncestorOfPage(currentOverlay, newPage)) {
currentOverlay.visible = false;
- if (currentOverlay.didClosePage) currentOverlay.didClosePage();
+ currentOverlay.didClosePage();
}
this.showPageByName(pageName, false, {hash: hash});
},
@@ -442,7 +439,7 @@ cr.define('cr.ui.pageManager', function() {
*/
willClose: function() {
var overlay = this.getVisibleOverlay_();
- if (overlay && overlay.didClosePage)
+ if (overlay)
overlay.didClosePage();
},
@@ -500,8 +497,7 @@ cr.define('cr.ui.pageManager', function() {
overlay.hash = hash;
if (!overlay.visible) {
overlay.visible = true;
- if (overlay.didShowPage)
- overlay.didShowPage();
+ overlay.didShowPage();
} else {
overlay.didChangeHash();
}
« no previous file with comments | « ui/webui/resources/js/cr/ui/page_manager/page.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698