Chromium Code Reviews| 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 properties: { | 13 properties: { |
| 14 /** | 14 /** |
| 15 * Preferences state. | 15 * Preferences state. |
| 16 */ | 16 */ |
| 17 prefs: { | 17 prefs: { |
| 18 type: Object, | 18 type: Object, |
| 19 notify: true, | 19 notify: true, |
| 20 }, | 20 }, |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * The current active route. | 23 * The current active route. |
| 24 */ | 24 */ |
| 25 currentRoute: { | 25 currentRoute: { |
| 26 observer: 'currentRouteChanged_', | |
| 26 type: Object, | 27 type: Object, |
| 27 notify: true, | 28 notify: true, |
| 28 }, | 29 }, |
| 29 | 30 |
| 30 /** @private */ | 31 /** @private */ |
| 31 showClearBrowsingDataDialog_: Boolean, | 32 showClearBrowsingDataDialog_: Boolean, |
| 32 }, | 33 }, |
| 33 | 34 |
| 34 ready: function() { | 35 ready: function() { |
| 35 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 36 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
| 36 }, | 37 }, |
| 37 | 38 |
| 39 /** | |
| 40 * @param {!SettingsRoute} newRoute | |
| 41 * @param {!SettingsRoute} oldRoute | |
| 42 * @private | |
| 43 */ | |
| 44 currentRouteChanged_: function(newRoute, oldRoute) { | |
| 45 if (newRoute.subpage == 'clear-browsing-data') | |
|
michaelpg
2016/06/27 19:33:49
add a TODO to not do this
| |
| 46 this.showClearBrowsingDataDialog_ = true; | |
| 47 else if (oldRoute && oldRoute.subpage == 'clear-browsing-data') | |
| 48 this.showClearBrowsingDataDialog_ = false; | |
| 49 }, | |
| 50 | |
| 38 /** @private */ | 51 /** @private */ |
| 39 onManageCertificatesTap_: function() { | 52 onManageCertificatesTap_: function() { |
| 40 <if expr="use_nss_certs"> | 53 <if expr="use_nss_certs"> |
| 41 this.$.pages.setSubpageChain(['manage-certificates']); | 54 this.$.pages.setSubpageChain(['manage-certificates']); |
| 42 </if> | 55 </if> |
| 43 <if expr="is_win or is_macosx"> | 56 <if expr="is_win or is_macosx"> |
| 44 settings.PrivacyPageBrowserProxyImpl.getInstance(). | 57 settings.PrivacyPageBrowserProxyImpl.getInstance(). |
| 45 showManageSSLCertificates(); | 58 showManageSSLCertificates(); |
| 46 </if> | 59 </if> |
| 47 }, | 60 }, |
| 48 | 61 |
| 49 /** @private */ | 62 /** @private */ |
| 50 onSiteSettingsTap_: function() { | 63 onSiteSettingsTap_: function() { |
| 51 this.$.pages.setSubpageChain(['site-settings']); | 64 this.$.pages.setSubpageChain(['site-settings']); |
| 52 }, | 65 }, |
| 53 | 66 |
| 54 /** @private */ | 67 /** @private */ |
| 55 onClearBrowsingDataTap_: function() { | 68 onClearBrowsingDataTap_: function() { |
| 56 this.showClearBrowsingDataDialog_ = true; | 69 this.currentRoute = { |
| 70 url: '/clearBrowserData', | |
| 71 page: 'advanced', | |
| 72 section: 'privacy', | |
| 73 subpage: ['clear-browsing-data'], | |
| 74 }; | |
| 57 }, | 75 }, |
| 58 | 76 |
| 59 /** | 77 /** |
| 60 * @param {!Event} event | 78 * @param {!Event} event |
| 61 * @private | 79 * @private |
| 62 */ | 80 */ |
| 63 onIronOverlayClosed_: function(event) { | 81 onIronOverlayClosed_: function(event) { |
| 64 if (Polymer.dom(event).rootTarget.tagName == 'CR-DIALOG') | 82 if (Polymer.dom(event).rootTarget.tagName == 'CR-DIALOG') |
| 65 this.showClearBrowsingDataDialog_ = false; | 83 this.showClearBrowsingDataDialog_ = false; |
| 66 }, | 84 }, |
| 67 }); | 85 }); |
| OLD | NEW |