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

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

Issue 2692213005: Reland: MD Settings: Fix the Network Prediction toggle box. (Closed)
Patch Set: Address comments 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 24b6a3105db3f896730fbe485cdd5377eaee5147..825633f929ffc159ac677f3a70cc9916a6b7c954 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',
@@ -63,6 +76,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() {
@@ -223,3 +247,4 @@ Polymer({
: this.i18n('siteSettingsBlocked');
},
});
+})();
« no previous file with comments | « chrome/browser/resources/settings/privacy_page/privacy_page.html ('k') | chrome/test/data/webui/settings/checkbox_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698