| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 * Called when a site within a category has been changed. | 64 * Called when a site within a category has been changed. |
| 65 * @param {number} category The category that changed. | 65 * @param {number} category The category that changed. |
| 66 * @param {string} site The site that changed. | 66 * @param {string} site The site that changed. |
| 67 * @private | 67 * @private |
| 68 */ | 68 */ |
| 69 sitePermissionChanged_: function(category, site) { | 69 sitePermissionChanged_: function(category, site) { |
| 70 if (category == this.category && (site == '' || site == this.site.origin)) { | 70 if (category == this.category && (site == '' || site == this.site.origin)) { |
| 71 // TODO(finnur): Send down the full SiteException, not just a string. | 71 // TODO(finnur): Send down the full SiteException, not just a string. |
| 72 this.siteChanged_({ | 72 this.siteChanged_({ |
| 73 origin: site, | 73 origin: site, |
| 74 originForDisplay: '', |
| 74 embeddingOrigin: '', | 75 embeddingOrigin: '', |
| 75 setting: '', | 76 setting: '', |
| 76 source: '', | 77 source: '', |
| 77 }); | 78 }); |
| 78 } | 79 } |
| 79 }, | 80 }, |
| 80 | 81 |
| 81 /** | 82 /** |
| 82 * Resets the category permission for this origin. | 83 * Resets the category permission for this origin. |
| 83 */ | 84 */ |
| (...skipping 10 matching lines...) Expand all Loading... |
| 94 // TODO(finnur): Compare with event.detail.item.dataset.permission directly | 95 // TODO(finnur): Compare with event.detail.item.dataset.permission directly |
| 95 // once attrForSelected is in use. | 96 // once attrForSelected is in use. |
| 96 var action = event.detail.item.innerText; | 97 var action = event.detail.item.innerText; |
| 97 var value = (action == this.i18n_.allowAction) ? | 98 var value = (action == this.i18n_.allowAction) ? |
| 98 settings.PermissionValues.ALLOW : | 99 settings.PermissionValues.ALLOW : |
| 99 settings.PermissionValues.BLOCK; | 100 settings.PermissionValues.BLOCK; |
| 100 this.setCategoryPermissionForOrigin( | 101 this.setCategoryPermissionForOrigin( |
| 101 this.site.origin, '', value, this.category); | 102 this.site.origin, '', value, this.category); |
| 102 }, | 103 }, |
| 103 }); | 104 }); |
| OLD | NEW |