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({ |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 /** | 22 /** |
23 * The current active route. | 23 * The current active route. |
24 */ | 24 */ |
25 currentRoute: { | 25 currentRoute: { |
26 type: Object, | 26 type: Object, |
27 notify: true, | 27 notify: true, |
28 }, | 28 }, |
29 | 29 |
30 /** @private */ | 30 /** @private */ |
31 showClearBrowsingDataDialog_: Boolean, | 31 showClearBrowsingDataDialog_: { |
| 32 computed: 'computeShowClearBrowsingDataDialog_(currentRoute)', |
| 33 type: Boolean, |
| 34 }, |
32 }, | 35 }, |
33 | 36 |
34 ready: function() { | 37 ready: function() { |
35 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 38 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
36 }, | 39 }, |
37 | 40 |
| 41 attached: function() { |
| 42 if (this.showClearBrowsingDataDialog_) { |
| 43 settings.main.rendered.then(function() { |
| 44 this.$$('settings-clear-browsing-data-dialog').$.dialog.refit(); |
| 45 }.bind(this)); |
| 46 } |
| 47 }, |
| 48 |
| 49 /** |
| 50 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. |
| 51 * @private |
| 52 */ |
| 53 computeShowClearBrowsingDataDialog_: function() { |
| 54 var route = this.currentRoute; |
| 55 return route && route.subpage && route.subpage[0] == 'clear-browsing-data'; |
| 56 }, |
| 57 |
38 /** @private */ | 58 /** @private */ |
39 onManageCertificatesTap_: function() { | 59 onManageCertificatesTap_: function() { |
40 <if expr="use_nss_certs"> | 60 <if expr="use_nss_certs"> |
41 this.$.pages.setSubpageChain(['manage-certificates']); | 61 this.$.pages.setSubpageChain(['manage-certificates']); |
42 </if> | 62 </if> |
43 <if expr="is_win or is_macosx"> | 63 <if expr="is_win or is_macosx"> |
44 settings.PrivacyPageBrowserProxyImpl.getInstance(). | 64 settings.PrivacyPageBrowserProxyImpl.getInstance(). |
45 showManageSSLCertificates(); | 65 showManageSSLCertificates(); |
46 </if> | 66 </if> |
47 }, | 67 }, |
(...skipping 10 matching lines...) Expand all Loading... |
58 | 78 |
59 /** | 79 /** |
60 * @param {!Event} event | 80 * @param {!Event} event |
61 * @private | 81 * @private |
62 */ | 82 */ |
63 onIronOverlayClosed_: function(event) { | 83 onIronOverlayClosed_: function(event) { |
64 if (Polymer.dom(event).rootTarget.tagName == 'CR-DIALOG') | 84 if (Polymer.dom(event).rootTarget.tagName == 'CR-DIALOG') |
65 this.showClearBrowsingDataDialog_ = false; | 85 this.showClearBrowsingDataDialog_ = false; |
66 }, | 86 }, |
67 }); | 87 }); |
OLD | NEW |