Index: chrome/browser/resources/settings/settings_main/settings_main.js |
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js |
index f80a8512c0c54b21bc89b73ddfbf8271534494f2..d1c7410cefe5ce371ceeaea19cb9ca8b4d0c92ad 100644 |
--- a/chrome/browser/resources/settings/settings_main/settings_main.js |
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js |
@@ -54,6 +54,15 @@ Polymer({ |
value: false, |
notify: true, |
}, |
+ |
+ /** |
+ * Dictionary defining page visibility. |
+ * @type {!GuestModePageVisibility} |
+ */ |
+ pageVisibility: { |
+ type: Object, |
+ value: function() { return {}; }, |
+ }, |
}, |
/** @override */ |
@@ -104,6 +113,7 @@ Polymer({ |
* @param {boolean} showBasicPage |
* @param {boolean} inSubpage |
* @return {boolean} |
+ * @private |
*/ |
showAdvancedToggle_: function(showBasicPage, inSubpage) { |
return showBasicPage && !inSubpage; |
@@ -120,6 +130,12 @@ Polymer({ |
if (newRoute.page == 'about') { |
this.showPages_ = {about: true, basic: false, advanced: false}; |
} else { |
+ |
+ if (newRoute.page == 'advanced') { |
+ assert(!this.pageVisibility || |
+ this.pageVisibility.advancedSettings !== false); |
+ } |
+ |
this.showPages_ = { |
about: false, |
basic: newRoute.page == 'basic' || !this.inSubpage_, |
@@ -168,4 +184,13 @@ Polymer({ |
query, assert(this.$$('settings-advanced-page'))); |
}.bind(this), 0); |
}, |
+ |
+ /** |
+ * @param {(boolean|undefined)} visibility |
+ * @return {boolean} True unless visibility is false. |
+ * @private |
+ */ |
+ showAdvancedSettings_: function(visibility) { |
+ return visibility !== false; |
+ }, |
}); |