| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 * @private | 52 * @private |
| 53 */ | 53 */ |
| 54 siteChanged_: function(site) { | 54 siteChanged_: function(site) { |
| 55 this.$.details.hidden = true; | 55 this.$.details.hidden = true; |
| 56 | 56 |
| 57 this.browserProxy.getExceptionList(this.category).then( | 57 this.browserProxy.getExceptionList(this.category).then( |
| 58 function(exceptionList) { | 58 function(exceptionList) { |
| 59 for (var i = 0; i < exceptionList.length; ++i) { | 59 for (var i = 0; i < exceptionList.length; ++i) { |
| 60 if (exceptionList[i].embeddingOrigin == site.embeddingOrigin && | 60 if (exceptionList[i].embeddingOrigin == site.embeddingOrigin && |
| 61 this.sameOrigin_(exceptionList[i].origin, site.origin)) { | 61 this.sameOrigin_(exceptionList[i].origin, site.origin)) { |
| 62 this.$.permission.selected = exceptionList[i].setting; | 62 this.$.permission.value = exceptionList[i].setting; |
| 63 this.$.details.hidden = false; | 63 this.$.details.hidden = false; |
| 64 break; | 64 break; |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 }.bind(this)); | 67 }.bind(this)); |
| 68 }, | 68 }, |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * Called when a site within a category has been changed. | 71 * Called when a site within a category has been changed. |
| 72 * @param {number} category The category that changed. | 72 * @param {number} category The category that changed. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 92 */ | 92 */ |
| 93 resetPermission: function() { | 93 resetPermission: function() { |
| 94 this.browserProxy.resetCategoryPermissionForOrigin( | 94 this.browserProxy.resetCategoryPermissionForOrigin( |
| 95 this.site.origin, this.site.embeddingOrigin, this.category, | 95 this.site.origin, this.site.embeddingOrigin, this.category, |
| 96 this.site.incognito); | 96 this.site.incognito); |
| 97 this.$.details.hidden = true; | 97 this.$.details.hidden = true; |
| 98 }, | 98 }, |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * Handles the category permission changing for this origin. | 101 * Handles the category permission changing for this origin. |
| 102 * @param {!{detail: !{item: !{dataset: !{permissionValue: string}}}}} event | 102 * @private |
| 103 */ | 103 */ |
| 104 onPermissionMenuIronActivate_: function(event) { | 104 onPermissionSelectionChange_: function() { |
| 105 var value = event.detail.item.dataset.permissionValue; | |
| 106 this.browserProxy.setCategoryPermissionForOrigin( | 105 this.browserProxy.setCategoryPermissionForOrigin( |
| 107 this.site.origin, this.site.embeddingOrigin, this.category, value, | 106 this.site.origin, this.site.embeddingOrigin, this.category, |
| 108 this.site.incognito); | 107 this.$.permission.value, this.site.incognito); |
| 109 }, | 108 }, |
| 110 }); | 109 }); |
| OLD | NEW |