| 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 I18nBehavior, | 28 I18nBehavior, |
| 16 WebUIListenerBehavior, | 29 WebUIListenerBehavior, |
| 17 ], | 30 ], |
| 18 | 31 |
| 19 properties: { | 32 properties: { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 /** @private {chrome.settingsPrivate.PrefObject} */ | 69 /** @private {chrome.settingsPrivate.PrefObject} */ |
| 57 safeBrowsingExtendedReportingPref_: { | 70 safeBrowsingExtendedReportingPref_: { |
| 58 type: Object, | 71 type: Object, |
| 59 value: function() { | 72 value: function() { |
| 60 return /** @type {chrome.settingsPrivate.PrefObject} */({}); | 73 return /** @type {chrome.settingsPrivate.PrefObject} */({}); |
| 61 }, | 74 }, |
| 62 }, | 75 }, |
| 63 | 76 |
| 64 /** @private */ | 77 /** @private */ |
| 65 showClearBrowsingDataDialog_: Boolean, | 78 showClearBrowsingDataDialog_: Boolean, |
| 79 |
| 80 /** |
| 81 * Used for HTML bindings. This is defined as a property rather than within |
| 82 * the ready callback, because the value needs to be available before |
| 83 * local DOM initialization - otherwise, the toggle has unexpected behavior. |
| 84 * @private |
| 85 */ |
| 86 networkPredictionEnum_: { |
| 87 type: Object, |
| 88 value: NetworkPredictionOptions, |
| 89 }, |
| 66 }, | 90 }, |
| 67 | 91 |
| 68 ready: function() { | 92 ready: function() { |
| 69 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 93 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 70 | 94 |
| 71 this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); | 95 this.browserProxy_ = settings.PrivacyPageBrowserProxyImpl.getInstance(); |
| 72 | 96 |
| 73 // <if expr="_google_chrome and not chromeos"> | 97 // <if expr="_google_chrome and not chromeos"> |
| 74 var setMetricsReportingPref = this.setMetricsReportingPref_.bind(this); | 98 var setMetricsReportingPref = this.setMetricsReportingPref_.bind(this); |
| 75 this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref); | 99 this.addWebUIListener('metrics-reporting-change', setMetricsReportingPref); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 return value ? this.i18n('siteSettingsProtectedContentEnable') | 240 return value ? this.i18n('siteSettingsProtectedContentEnable') |
| 217 : this.i18n('siteSettingsBlocked'); | 241 : this.i18n('siteSettingsBlocked'); |
| 218 }, | 242 }, |
| 219 | 243 |
| 220 /** @private */ | 244 /** @private */ |
| 221 getProtectedContentIdentifiersLabel_: function(value) { | 245 getProtectedContentIdentifiersLabel_: function(value) { |
| 222 return value ? this.i18n('siteSettingsProtectedContentEnableIdentifiers') | 246 return value ? this.i18n('siteSettingsProtectedContentEnableIdentifiers') |
| 223 : this.i18n('siteSettingsBlocked'); | 247 : this.i18n('siteSettingsBlocked'); |
| 224 }, | 248 }, |
| 225 }); | 249 }); |
| 250 })(); |
| OLD | NEW |