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

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

Issue 2190453003: Guest mode page visibility patch set 11, minus dom.flush(), w/ overscroll fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@UpdateMocha
Patch Set: 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 0b94e78334c8f1b72da5dc3c7b5ab5dde1e96673..9d27c6512c1a58400fb07ec4068b9ad4d55c1ba5 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 the dom-if changes prior to calculating the overflow padding.
@@ -150,6 +163,9 @@ Polymer({
return 0;
}
+ // Ensure any dom-if reflects the current properties.
+ Polymer.dom.flush();
+
/**
* @param {!Element} element
* @return {number}
@@ -177,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 */
@@ -228,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