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

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

Issue 2681373002: MD Settings: Fix the Network Prediction toggle box. (Closed)
Patch Set: fix comment Created 3 years, 10 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/privacy_page/privacy_page.js
diff --git a/chrome/browser/resources/settings/privacy_page/privacy_page.js b/chrome/browser/resources/settings/privacy_page/privacy_page.js
index 8e0c4b029c5ad5253e57388a4c64b732355b14aa..e1c12a79f868ebed8e9cdfb66f9458f9c5c9304e 100644
--- a/chrome/browser/resources/settings/privacy_page/privacy_page.js
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page.js
@@ -7,6 +7,19 @@
* 'settings-privacy-page' is the settings page containing privacy and
* security settings.
*/
+(function() {
+
+/**
+ * Must be kept in sync with the C++ enum of the same name.
+ * @enum {number}
+ */
+var NetworkPredictionOptions = {
+ ALWAYS: 0,
+ WIFI_ONLY: 1,
+ NEVER: 2,
+ DEFAULT: 1
+};
+
Polymer({
is: 'settings-privacy-page',
@@ -42,6 +55,17 @@ Polymer({
/** @private */
showClearBrowsingDataDialog_: Boolean,
+
+ /**
+ * Used for HTML bindings. This is defined as a property rather than within
+ * the ready callback, because the value needs to be available before
+ * local DOM initialization - otherwise, the toggle has unexpected behavior.
+ * @private
+ */
+ networkPredictionEnum_: {
+ type: Object,
+ value: NetworkPredictionOptions,
+ },
},
ready: function() {
@@ -185,3 +209,4 @@ Polymer({
return value ? trueLabel : falseLabel;
},
});
+})();

Powered by Google App Engine
This is Rietveld 408576698