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_: { | 31 showClearBrowsingDataDialog_: Boolean, |
32 computed: 'computeShowClearBrowsingDataDialog_(currentRoute)', | |
33 type: Boolean, | |
34 }, | |
35 }, | 32 }, |
36 | 33 |
37 ready: function() { | 34 ready: function() { |
38 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 35 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
39 }, | 36 }, |
40 | 37 |
41 /** @suppress {missingProperties} */ | |
42 attached: function() { | |
43 settings.main.rendered.then(function() { | |
michaelpg
2016/06/29 01:54:40
Haha, I guess that's what happens when you suppres
Dan Beam
2016/06/29 20:42:49
tests aren't compiled
michaelpg
2016/06/29 21:03:29
I didn't mean to imply causality per se. "And that
| |
44 if (this.showClearBrowsingDataDialog_) { | |
45 var dialog = this.$$('settings-clear-browsing-data-dialog').$.dialog; | |
46 // TODO(dbeam): cast to a CrDialogElement when it compiles. | |
47 dialog.refit(); | |
48 } | |
49 }.bind(this)); | |
50 }, | |
51 | |
52 /** | |
53 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. | |
54 * @private | |
55 */ | |
56 computeShowClearBrowsingDataDialog_: function() { | |
57 var route = this.currentRoute; | |
58 return route && route.dialog == 'clear-browsing-data'; | |
59 }, | |
60 | |
61 /** @private */ | 38 /** @private */ |
62 onManageCertificatesTap_: function() { | 39 onManageCertificatesTap_: function() { |
63 <if expr="use_nss_certs"> | 40 <if expr="use_nss_certs"> |
64 var pages = /** @type {!SettingsAnimatedPagesElement} */(this.$.pages); | 41 this.$.pages.setSubpageChain(['manage-certificates']); |
65 pages.setSubpageChain(['manage-certificates']); | |
66 </if> | 42 </if> |
67 <if expr="is_win or is_macosx"> | 43 <if expr="is_win or is_macosx"> |
68 settings.PrivacyPageBrowserProxyImpl.getInstance(). | 44 settings.PrivacyPageBrowserProxyImpl.getInstance(). |
69 showManageSSLCertificates(); | 45 showManageSSLCertificates(); |
70 </if> | 46 </if> |
71 }, | 47 }, |
72 | 48 |
73 /** @private */ | 49 /** @private */ |
74 onSiteSettingsTap_: function() { | 50 onSiteSettingsTap_: function() { |
75 var pages = /** @type {!SettingsAnimatedPagesElement} */(this.$.pages); | 51 this.$.pages.setSubpageChain(['site-settings']); |
76 pages.setSubpageChain(['site-settings']); | |
77 }, | 52 }, |
78 | 53 |
79 /** @private */ | 54 /** @private */ |
80 onClearBrowsingDataTap_: function() { | 55 onClearBrowsingDataTap_: function() { |
81 this.currentRoute = { | 56 this.showClearBrowsingDataDialog_ = true; |
82 page: this.currentRoute.page, | |
83 section: this.currentRoute.section, | |
84 subpage: this.currentRoute.subpage, | |
85 dialog: 'clear-browsing-data', | |
86 }; | |
87 }, | 57 }, |
88 | 58 |
89 /** | 59 /** |
90 * @param {!Event} event | 60 * @param {!Event} event |
91 * @private | 61 * @private |
92 */ | 62 */ |
93 onIronOverlayClosed_: function(event) { | 63 onIronOverlayClosed_: function(event) { |
94 if (Polymer.dom(event).rootTarget.tagName != 'CR-DIALOG') | 64 if (Polymer.dom(event).rootTarget.tagName == 'CR-DIALOG') |
95 return; | 65 this.showClearBrowsingDataDialog_ = false; |
96 | |
97 this.currentRoute = { | |
98 page: this.currentRoute.page, | |
99 section: this.currentRoute.section, | |
100 subpage: this.currentRoute.subpage, | |
101 // Drop dialog key. | |
102 }; | |
103 }, | 66 }, |
104 }); | 67 }); |
OLD | NEW |