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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 /** | 49 /** |
50 * Sets the site to display. | 50 * Sets the site to display. |
51 * @param {!SiteException} site The site to display. | 51 * @param {!SiteException} site The site to display. |
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.value = 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. |
73 * @param {string} origin The origin of the site that changed. | 73 * @param {string} origin The origin of the site that changed. |
74 * @param {string} embeddingOrigin The embedding origin of the site that | 74 * @param {string} embeddingOrigin The embedding origin of the site that |
75 * changed. | 75 * changed. |
76 * @private | 76 * @private |
77 */ | 77 */ |
(...skipping 22 matching lines...) Expand all Loading... |
100 /** | 100 /** |
101 * Handles the category permission changing for this origin. | 101 * Handles the category permission changing for this origin. |
102 * @private | 102 * @private |
103 */ | 103 */ |
104 onPermissionSelectionChange_: function() { | 104 onPermissionSelectionChange_: function() { |
105 this.browserProxy.setCategoryPermissionForOrigin( | 105 this.browserProxy.setCategoryPermissionForOrigin( |
106 this.site.origin, this.site.embeddingOrigin, this.category, | 106 this.site.origin, this.site.embeddingOrigin, this.category, |
107 this.$.permission.value, this.site.incognito); | 107 this.$.permission.value, this.site.incognito); |
108 }, | 108 }, |
109 }); | 109 }); |
OLD | NEW |