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

Unified Diff: chrome/browser/resources/options/options_page.js

Issue 7093004: Sync: Refactor the ProfileSyncService and sync setup flow to remove use of WebUI from PSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes and cleanups. Created 9 years, 6 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/profiles/profile_manager.cc ('k') | chrome/browser/resources/options/personal_options.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options/options_page.js
diff --git a/chrome/browser/resources/options/options_page.js b/chrome/browser/resources/options/options_page.js
index aad5f5c76222a238fb88ab6135f2c5defbe48ce3..c5296397c2e884a91319d833739c8c078dbdf2ab 100644
--- a/chrome/browser/resources/options/options_page.js
+++ b/chrome/browser/resources/options/options_page.js
@@ -118,11 +118,14 @@ cr.define('options', function() {
page.willHidePage();
}
+ var prevVisible = false;
+
// Update visibilities to show only the hierarchy of the target page.
for (var name in this.registeredPages) {
var page = this.registeredPages[name];
if (!page.parentPage && isRootPageLocked)
continue;
+ prevVisible = page.visible;
page.visible = name == pageName ||
(!document.documentElement.classList.contains('hide-menu') &&
page.isAncestorOfPage(targetPage));
@@ -140,7 +143,7 @@ cr.define('options', function() {
var page = this.registeredPages[name];
if (!page.parentPage && isRootPageLocked)
continue;
- if (page.didShowPage && (name == pageName ||
+ if (!prevVisible && page.didShowPage && (name == pageName ||
page.isAncestorOfPage(targetPage)))
page.didShowPage();
}
@@ -207,8 +210,11 @@ cr.define('options', function() {
if ((!rootPage || !rootPage.sticky) && overlay.parentPage)
this.showPageByName(overlay.parentPage.name, false);
- overlay.visible = true;
- if (overlay.didShowPage) overlay.didShowPage();
+ if (!overlay.visible) {
+ overlay.visible = true;
+ if (overlay.didShowPage) overlay.didShowPage();
+ }
+
return true;
};
@@ -222,15 +228,6 @@ cr.define('options', function() {
};
/**
- * @return {boolean} True if the visible overlay should be closed.
- * @private
- */
- OptionsPage.shouldCloseOverlay_ = function() {
- var overlay = this.getVisibleOverlay_();
- return overlay && overlay.shouldClose();
- };
-
- /**
* Returns the currently visible overlay, or null if no page is visible.
* @return {OptionPage} The visible overlay.
*/
@@ -746,12 +743,10 @@ cr.define('options', function() {
OptionsPage.keyDownEventHandler_ = function(event) {
// Close the top overlay or sub-page on esc.
if (event.keyCode == 27) { // Esc
- if (this.isOverlayVisible_()) {
- if (this.shouldCloseOverlay_())
- this.closeOverlay();
- } else {
+ if (this.isOverlayVisible_())
+ this.closeOverlay();
+ else
this.closeTopSubPage_();
- }
}
};
@@ -1008,15 +1003,6 @@ cr.define('options', function() {
canShowPage: function() {
return true;
},
-
- /**
- * Whether an overlay should be closed. Used by overlay implementation to
- * handle special closing behaviors.
- * @return {boolean} True if the overlay should be closed.
- */
- shouldClose: function() {
- return true;
- },
};
// Export
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | chrome/browser/resources/options/personal_options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698