Chromium Code Reviews| 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' show the details (permissions and usage) for a given origin | 7 * 'site-details' show the details (permissions and usage) for a given origin |
| 8 * under Site Settings. | 8 * under Site Settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 listeners: { | 39 listeners: { |
| 40 'usage-deleted': 'onUsageDeleted', | 40 'usage-deleted': 'onUsageDeleted', |
| 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 /** | 47 /** |
| 48 * @param {string} url Location of an image to get a set of icons for. | |
| 49 * @return {string} A set of icon URLs. | |
| 50 * @private | |
| 51 */ | |
| 52 getIconSet_: function(url) { | |
| 53 return cr.icon.getFavicon(this.ensureUrlHasScheme(url)); | |
| 54 }, | |
|
Finnur
2016/09/14 11:00:21
The behavior already has a computeSiteIcon functio
dschuyler
2016/09/14 19:11:33
Done.
| |
| 55 | |
| 56 /** | |
| 48 * Handler for when the origin changes. | 57 * Handler for when the origin changes. |
| 49 */ | 58 */ |
| 50 onSiteChanged_: function() { | 59 onSiteChanged_: function() { |
| 51 // Using originForDisplay avoids the [*.] prefix that some exceptions use. | 60 // Using originForDisplay avoids the [*.] prefix that some exceptions use. |
| 52 var url = new URL(this.ensureUrlHasScheme(this.site.originForDisplay)); | 61 var url = new URL(this.ensureUrlHasScheme(this.site.originForDisplay)); |
| 53 this.$.usageApi.fetchUsageTotal(url.hostname); | 62 this.$.usageApi.fetchUsageTotal(url.hostname); |
| 54 }, | 63 }, |
| 55 | 64 |
| 56 /** | 65 /** |
| 57 * Clears all data stored for the current origin. | 66 * Clears all data stored for the current origin. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 | 103 |
| 95 /** | 104 /** |
| 96 * Returns true if one or more permission is showing. | 105 * Returns true if one or more permission is showing. |
| 97 */ | 106 */ |
| 98 permissionShowing_: function() { | 107 permissionShowing_: function() { |
| 99 return Array.prototype.some.call( | 108 return Array.prototype.some.call( |
| 100 this.root.querySelectorAll('site-details-permission'), | 109 this.root.querySelectorAll('site-details-permission'), |
| 101 function(element) { return element.offsetHeight > 0; }); | 110 function(element) { return element.offsetHeight > 0; }); |
| 102 }, | 111 }, |
| 103 }); | 112 }); |
| OLD | NEW |