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 b23930bcc55a02cca9df6a3e898753257a2916a0..e30651ff915cb433794ea73a289a7e6f3f55ff09 100644 |
--- a/chrome/browser/resources/settings/settings_main/settings_main.js |
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js |
@@ -63,6 +63,15 @@ Polymer({ |
value: false, |
notify: true, |
}, |
+ |
+ /** |
+ * Dictionary defining page visibility. |
+ * @type {!GuestModePageVisibility} |
+ */ |
+ pageVisibility: { |
+ type: Object, |
+ value: function() { return {}; }, |
+ }, |
}, |
/** @override */ |
@@ -123,6 +132,10 @@ Polymer({ |
this.showBasicPage_ = this.showAdvancedToggle_ || newRoute.page == 'basic'; |
+ if (newRoute.page == 'advanced') { |
+ assert(this.showAdvancedSettings(this.pageVisibility.advancedSettings)); |
+ } |
+ |
this.showAdvancedPage_ = |
(this.isAdvancedMenuOpen_ && this.showAdvancedToggle_) || |
newRoute.page == 'advanced'; |
@@ -168,4 +181,12 @@ Polymer({ |
query, assert(this.$$('settings-advanced-page'))); |
}.bind(this), 0); |
}, |
+ |
+ /** |
+ * @param {(boolean|undefined)} visibility |
+ * @return {boolean} True unless visibility is false. |
+ */ |
dpapad
2016/07/22 22:40:48
Nit: Mark as @private and rename to showAdvancedSe
Moe
2016/07/24 23:54:27
Done.
|
+ showAdvancedSettings: function(visibility) { |
+ return visibility !== false; |
+ }, |
}); |