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 26 matching lines...) Expand all Loading... |
37 * Dictionary defining page visibility. | 37 * Dictionary defining page visibility. |
38 * @type {!PrivacyPageVisibility} | 38 * @type {!PrivacyPageVisibility} |
39 */ | 39 */ |
40 pageVisibility: Object, | 40 pageVisibility: Object, |
41 }, | 41 }, |
42 | 42 |
43 ready: function() { | 43 ready: function() { |
44 this.ContentSettingsTypes = settings.ContentSettingsTypes; | 44 this.ContentSettingsTypes = settings.ContentSettingsTypes; |
45 }, | 45 }, |
46 | 46 |
47 /** @suppress {missingProperties} */ | |
48 attached: function() { | |
49 settings.main.rendered.then(function() { | |
50 if (this.showClearBrowsingDataDialog_) { | |
51 var dialog = this.$$('settings-clear-browsing-data-dialog').$.dialog; | |
52 // TODO(dbeam): cast to a CrDialogElement when it compiles. | |
53 dialog.refit(); | |
54 } | |
55 }.bind(this)); | |
56 }, | |
57 | |
58 /** | 47 /** |
59 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. | 48 * @return {boolean} Whether the Clear Browsing Data dialog should be showing. |
60 * @private | 49 * @private |
61 */ | 50 */ |
62 computeShowClearBrowsingDataDialog_: function() { | 51 computeShowClearBrowsingDataDialog_: function() { |
63 var route = this.currentRoute; | 52 var route = this.currentRoute; |
64 return route && route.dialog == 'clear-browsing-data'; | 53 return route && route.dialog == 'clear-browsing-data'; |
65 }, | 54 }, |
66 | 55 |
67 /** @private */ | 56 /** @private */ |
(...skipping 12 matching lines...) Expand all Loading... |
80 onSiteSettingsTap_: function() { | 69 onSiteSettingsTap_: function() { |
81 var pages = /** @type {!SettingsAnimatedPagesElement} */(this.$.pages); | 70 var pages = /** @type {!SettingsAnimatedPagesElement} */(this.$.pages); |
82 settings.navigateTo(settings.Route.SITE_SETTINGS); | 71 settings.navigateTo(settings.Route.SITE_SETTINGS); |
83 }, | 72 }, |
84 | 73 |
85 /** @private */ | 74 /** @private */ |
86 onClearBrowsingDataTap_: function() { | 75 onClearBrowsingDataTap_: function() { |
87 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); | 76 settings.navigateTo(settings.Route.CLEAR_BROWSER_DATA); |
88 }, | 77 }, |
89 | 78 |
90 /** | 79 /** @private */ |
91 * @param {!Event} event | 80 onDialogClosed_: function() { |
92 * @private | 81 settings.navigateTo(settings.Route.PRIVACY); |
93 */ | |
94 onIronOverlayClosed_: function(event) { | |
95 if (Polymer.dom(event).rootTarget.tagName == 'CR-DIALOG') | |
96 settings.navigateTo(settings.Route.PRIVACY); | |
97 }, | 82 }, |
98 }); | 83 }); |
OLD | NEW |