| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-privacy-page' is the settings page containing privacy and | 7 * 'settings-privacy-page' is the settings page containing privacy and |
| 8 * security settings. | 8 * security settings. |
| 9 */ | 9 */ |
| 10 (function() { |
| 11 |
| 12 /** |
| 13 * Must be kept in sync with the C++ enum of the same name. |
| 14 * @enum {number} |
| 15 */ |
| 16 var NetworkPredictionOptions = { |
| 17 ALWAYS: 0, |
| 18 WIFI_ONLY: 1, |
| 19 NEVER: 2, |
| 20 DEFAULT: 1 |
| 21 }; |
| 22 |
| 10 Polymer({ | 23 Polymer({ |
| 11 is: 'settings-privacy-page', | 24 is: 'settings-privacy-page', |
| 12 | 25 |
| 13 behaviors: [ | 26 behaviors: [ |
| 14 settings.RouteObserverBehavior, | 27 settings.RouteObserverBehavior, |
| 15 WebUIListenerBehavior, | 28 WebUIListenerBehavior, |
| 16 ], | 29 ], |
| 17 | 30 |
| 18 properties: { | 31 properties: { |
| 19 /** | 32 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 35 metricsReporting_: Object, | 48 metricsReporting_: Object, |
| 36 | 49 |
| 37 showRestart_: Boolean, | 50 showRestart_: Boolean, |
| 38 // </if> | 51 // </if> |
| 39 | 52 |
| 40 /** @private */ | 53 /** @private */ |
| 41 safeBrowsingExtendedReportingEnabled_: Boolean, | 54 safeBrowsingExtendedReportingEnabled_: Boolean, |
| 42 | 55 |
| 43 /** @private */ | 56 /** @private */ |
| 44 showClearBrowsingDataDialog_: Boolean, | 57 showClearBrowsingDataDialog_: Boolean, |
| 58 |
| 59 /** |
| 60 * Used for HTML bindings. This is defined as a property rather than within |
| 61 * the ready callback, because the value needs to be available before |
| 62 * local DOM initialization - otherwise, the toggle has unexpected behavior. |
| 63 * @private |
| 64 */ |
| 65 networkPredictionEnum_: { |
| 66 type: Object, |
| 67 value: NetworkPredictionOptions, |
| 68 }, |
| 45 }, | 69 }, |
| 46 | 70 |
| 47 ready: function() { | 71 ready: function() { |
| 48 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 72 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 49 | 73 |
| 50 // <if expr="_google_chrome and not chromeos"> | 74 // <if expr="_google_chrome and not chromeos"> |
| 51 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this); | 75 var boundSetMetricsReporting = this.setMetricsReporting_.bind(this); |
| 52 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); | 76 this.addWebUIListener('metrics-reporting-change', boundSetMetricsReporting); |
| 53 | 77 |
| 54 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 78 var browserProxy = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 * Works like a ternary operator. E.g. (value ? trueLabel: falseLabel). | 202 * Works like a ternary operator. E.g. (value ? trueLabel: falseLabel). |
| 179 * @param {boolean} value | 203 * @param {boolean} value |
| 180 * @param {string} trueLabel True label (for example, 'Allow DRM'). | 204 * @param {string} trueLabel True label (for example, 'Allow DRM'). |
| 181 * @param {string} falseLabel False label (for example, 'Blocked'). | 205 * @param {string} falseLabel False label (for example, 'Blocked'). |
| 182 * @private | 206 * @private |
| 183 */ | 207 */ |
| 184 getStringTernary_: function(value, trueLabel, falseLabel) { | 208 getStringTernary_: function(value, trueLabel, falseLabel) { |
| 185 return value ? trueLabel : falseLabel; | 209 return value ? trueLabel : falseLabel; |
| 186 }, | 210 }, |
| 187 }); | 211 }); |
| 212 })(); |
| OLD | NEW |