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

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: rebase after overscrollHeight_() fix 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 09ee0bed7913be396e46497743b0fddfe90bca02..b01e20f964fab92e57ef890e12538228a77c0cdf 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -60,6 +60,15 @@ Polymer({
value: false,
notify: true,
},
+
+ /**
+ * Dictionary defining page visibility.
+ * @type {!GuestModePageVisibility}
+ */
+ pageVisibility: {
+ type: Object,
+ value: function() { return {}; },
+ },
},
/** @override */
@@ -103,6 +112,7 @@ Polymer({
* @param {boolean} showBasicPage
* @param {boolean} inSubpage
* @return {boolean}
+ * @private
*/
showAdvancedToggle_: function(showBasicPage, inSubpage) {
return showBasicPage && !inSubpage;
@@ -126,8 +136,11 @@ Polymer({
(!this.inSubpage_ && this.advancedToggleExpanded_),
};
- if (this.showPages_.advanced)
+ if (this.showPages_.advanced) {
+ assert(!this.pageVisibility ||
+ this.pageVisibility.advancedSettings !== false);
this.advancedToggleExpanded_ = true;
+ }
}
// Wait for any other changes prior to calculating the overflow padding.
@@ -180,7 +193,9 @@ Polymer({
// |lastSection| may be null in unit tests.
if (!lastSection)
return 0;
- return calcHeight(lastSection) - this.$$('#toggleContainer').offsetHeight;
+ var toggleContainer = this.$$('#toggleContainer');
+ return calcHeight(lastSection) -
+ (toggleContainer ? toggleContainer.offsetHeight : 0);
},
/** @private */
@@ -231,4 +246,13 @@ Polymer({
}.bind(this));
}.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