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 20 matching lines...) Expand all Loading... |
31 showClearBrowsingDataDialog_: { | 31 showClearBrowsingDataDialog_: { |
32 computed: 'computeShowClearBrowsingDataDialog_(currentRoute)', | 32 computed: 'computeShowClearBrowsingDataDialog_(currentRoute)', |
33 type: Boolean, | 33 type: Boolean, |
34 }, | 34 }, |
35 }, | 35 }, |
36 | 36 |
37 ready: function() { | 37 ready: function() { |
38 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 38 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
39 }, | 39 }, |
40 | 40 |
41 /** @suppress {missingProperties} */ | |
42 attached: function() { | |
43 settings.main.rendered.then(function() { | |
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 /** | 41 /** |
53 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. | 42 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. |
54 * @private | 43 * @private |
55 */ | 44 */ |
56 computeShowClearBrowsingDataDialog_: function() { | 45 computeShowClearBrowsingDataDialog_: function() { |
57 var route = this.currentRoute; | 46 var route = this.currentRoute; |
58 return route && route.dialog == 'clear-browsing-data'; | 47 return route && route.dialog == 'clear-browsing-data'; |
59 }, | 48 }, |
60 | 49 |
61 /** @private */ | 50 /** @private */ |
(...skipping 21 matching lines...) Expand all Loading... |
83 section: 'privacy', | 72 section: 'privacy', |
84 subpage: [], | 73 subpage: [], |
85 dialog: 'clear-browsing-data', | 74 dialog: 'clear-browsing-data', |
86 }; | 75 }; |
87 }, | 76 }, |
88 | 77 |
89 /** | 78 /** |
90 * @param {!Event} event | 79 * @param {!Event} event |
91 * @private | 80 * @private |
92 */ | 81 */ |
93 onIronOverlayClosed_: function(event) { | 82 onDialogClosed_: function(event) { |
94 if (Polymer.dom(event).rootTarget.tagName != 'CR-DIALOG') | |
95 return; | |
96 | |
97 this.currentRoute = { | 83 this.currentRoute = { |
98 page: 'advanced', | 84 page: 'advanced', |
99 section: 'privacy', | 85 section: 'privacy', |
100 subpage: [], | 86 subpage: [], |
101 // Drop dialog key. | 87 // Drop dialog key. |
102 }; | 88 }; |
103 }, | 89 }, |
104 }); | 90 }); |
OLD | NEW |