| 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 Polymer({ | 10 Polymer({ |
| 11 is: 'settings-privacy-page', | 11 is: 'settings-privacy-page', |
| 12 | 12 |
| 13 behaviors: [settings.RouteObserverBehavior], |
| 14 |
| 13 properties: { | 15 properties: { |
| 14 /** | 16 /** |
| 15 * Preferences state. | 17 * Preferences state. |
| 16 */ | 18 */ |
| 17 prefs: { | 19 prefs: { |
| 18 type: Object, | 20 type: Object, |
| 19 notify: true, | 21 notify: true, |
| 20 }, | 22 }, |
| 21 | 23 |
| 22 /** | |
| 23 * The current active route. | |
| 24 */ | |
| 25 currentRoute: { | |
| 26 type: Object, | |
| 27 notify: true, | |
| 28 }, | |
| 29 | |
| 30 /** @private */ | 24 /** @private */ |
| 31 showClearBrowsingDataDialog_: { | 25 showClearBrowsingDataDialog_: Boolean, |
| 32 computed: 'computeShowClearBrowsingDataDialog_(currentRoute)', | |
| 33 type: Boolean, | |
| 34 }, | |
| 35 | 26 |
| 36 /** | 27 /** |
| 37 * Dictionary defining page visibility. | 28 * Dictionary defining page visibility. |
| 38 * @type {!PrivacyPageVisibility} | 29 * @type {!PrivacyPageVisibility} |
| 39 */ | 30 */ |
| 40 pageVisibility: Object, | 31 pageVisibility: Object, |
| 41 }, | 32 }, |
| 42 | 33 |
| 43 ready: function() { | 34 ready: function() { |
| 44 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 35 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 45 }, | 36 }, |
| 46 | 37 |
| 47 /** | 38 /** @protected */ |
| 48 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. | 39 currentRouteChanged: function() { |
| 49 * @private | 40 this.showClearBrowsingDataDialog_ = |
| 50 */ | 41 settings.getCurrentRoute().dialog == 'clear-browsing-data'; |
| 51 computeShowClearBrowsingDataDialog_: function() { | |
| 52 var route = this.currentRoute; | |
| 53 return route && route.dialog == 'clear-browsing-data'; | |
| 54 }, | 42 }, |
| 55 | 43 |
| 56 /** @private */ | 44 /** @private */ |
| 57 onManageCertificatesTap_: function() { | 45 onManageCertificatesTap_: function() { |
| 58 <if expr="use_nss_certs"> | 46 <if expr="use_nss_certs"> |
| 59 settings.navigateTo(settings.Route.CERTIFICATES); | 47 settings.navigateTo(settings.Route.CERTIFICATES); |
| 60 </if> | 48 </if> |
| 61 <if expr="is_win or is_macosx"> | 49 <if expr="is_win or is_macosx"> |
| 62 settings.PrivacyPageBrowserProxyImpl.getInstance(). | 50 settings.PrivacyPageBrowserProxyImpl.getInstance(). |
| 63 showManageSSLCertificates(); | 51 showManageSSLCertificates(); |
| 64 </if> | 52 </if> |
| 65 }, | 53 }, |
| 66 | 54 |
| 67 /** @private */ | 55 /** @private */ |
| 68 onSiteSettingsTap_: function() { | 56 onSiteSettingsTap_: function() { |
| 69 settings.navigateTo(settings.Route.SITE_SETTINGS); | 57 settings.navigateTo(settings.Route.SITE_SETTINGS); |
| 70 }, | 58 }, |
| 71 | 59 |
| 72 /** @private */ | 60 /** @private */ |
| 73 onClearBrowsingDataTap_: function() { | 61 onClearBrowsingDataTap_: function() { |
| 74 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); | 62 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); |
| 75 }, | 63 }, |
| 76 | 64 |
| 77 /** @private */ | 65 /** @private */ |
| 78 onDialogClosed_: function() { | 66 onDialogClosed_: function() { |
| 79 settings.navigateTo(settings.Route.PRIVACY); | 67 settings.navigateTo(settings.Route.PRIVACY); |
| 80 }, | 68 }, |
| 81 }); | 69 }); |
| OLD | NEW |