| 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 * 'site-details-permission' handles showing the state of one permission, such | 7 * 'site-details-permission' handles showing the state of one permission, such |
| 8 * as Geolocation, for a given origin. | 8 * as Geolocation, for a given origin. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 blockAction: loadTimeData.getString('siteSettingsActionBlock'), | 28 blockAction: loadTimeData.getString('siteSettingsActionBlock'), |
| 29 }; | 29 }; |
| 30 }, | 30 }, |
| 31 }, | 31 }, |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 observers: ['siteChanged_(site, category)'], | 34 observers: ['siteChanged_(site, category)'], |
| 35 | 35 |
| 36 /** @override */ | 36 /** @override */ |
| 37 attached: function() { | 37 attached: function() { |
| 38 this.PermissionValues = settings.PermissionValues; | |
| 39 this.addWebUIListener('contentSettingSitePermissionChanged', | 38 this.addWebUIListener('contentSettingSitePermissionChanged', |
| 40 this.sitePermissionChanged_.bind(this)); | 39 this.sitePermissionChanged_.bind(this)); |
| 41 }, | 40 }, |
| 42 | 41 |
| 43 /** | 42 /** |
| 44 * Returns true if the origins match, e.g. http://google.com and | 43 * Returns true if the origins match, e.g. http://google.com and |
| 45 * http://[*.]google.com. | 44 * http://[*.]google.com. |
| 46 * @param {string} left The first origin to compare. | 45 * @param {string} left The first origin to compare. |
| 47 * @param {string} right The second origin to compare. | 46 * @param {string} right The second origin to compare. |
| 48 * @return {boolean} True if the origins are the same. | 47 * @return {boolean} True if the origins are the same. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 /** | 101 /** |
| 103 * Handles the category permission changing for this origin. | 102 * Handles the category permission changing for this origin. |
| 104 * @param {!{detail: !{item: !{dataset: !{permissionValue: string}}}}} event | 103 * @param {!{detail: !{item: !{dataset: !{permissionValue: string}}}}} event |
| 105 */ | 104 */ |
| 106 onPermissionMenuIronActivate_: function(event) { | 105 onPermissionMenuIronActivate_: function(event) { |
| 107 var value = event.detail.item.dataset.permissionValue; | 106 var value = event.detail.item.dataset.permissionValue; |
| 108 this.setCategoryPermissionForOrigin( | 107 this.setCategoryPermissionForOrigin( |
| 109 this.site.origin, '', this.category, value); | 108 this.site.origin, '', this.category, value); |
| 110 }, | 109 }, |
| 111 }); | 110 }); |
| OLD | NEW |