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

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2106103006: MD Settings: cr/cros - Guest mode page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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
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;
+ },
});

Powered by Google App Engine
This is Rietveld 408576698