Chromium Code Reviews| Index: chrome/browser/resources/settings/site_settings/site_details_permission.js |
| diff --git a/chrome/browser/resources/settings/site_settings/site_details_permission.js b/chrome/browser/resources/settings/site_settings/site_details_permission.js |
| index b2f4ce64725c50885d8ce6af5f0a8f42729688b2..05101a8480333f552cd5df7503aca0b61c5679b6 100644 |
| --- a/chrome/browser/resources/settings/site_settings/site_details_permission.js |
| +++ b/chrome/browser/resources/settings/site_settings/site_details_permission.js |
| @@ -46,19 +46,22 @@ Polymer({ |
| * @private |
| */ |
| siteChanged_: function(site) { |
| - this.$.details.hidden = true; |
| + // Finish this asynchronously to give |category| a chance to be set first. |
|
michaelpg
2016/04/05 18:22:53
May be preferable to keep this synchronous by maki
Finnur
2016/04/06 00:25:19
Doh. Of course. Can't believe I overlooked that. M
|
| + this.async(function() { |
| + this.$.details.hidden = true; |
| - var prefsProxy = settings.SiteSettingsPrefsBrowserProxyImpl.getInstance(); |
| - prefsProxy.getExceptionList(this.category).then(function(exceptionList) { |
| - for (var i = 0; i < exceptionList.length; ++i) { |
| - if (exceptionList[i].origin == site.origin) { |
| - // TODO(finnur): Convert to use attrForSelected. |
| - this.$.permission.selected = exceptionList[i].setting == |
| - settings.PermissionStringValues.ALLOW ? 0 : 1; |
| - this.$.details.hidden = false; |
| + var prefsProxy = settings.SiteSettingsPrefsBrowserProxyImpl.getInstance(); |
| + prefsProxy.getExceptionList(this.category).then(function(exceptionList) { |
| + for (var i = 0; i < exceptionList.length; ++i) { |
| + if (exceptionList[i].origin == site.origin) { |
| + // TODO(finnur): Convert to use attrForSelected. |
| + this.$.permission.selected = exceptionList[i].setting == |
| + settings.PermissionStringValues.ALLOW ? 0 : 1; |
| + this.$.details.hidden = false; |
| + } |
| } |
| - } |
| - }.bind(this)); |
| + }.bind(this)); |
| + }); |
| }, |
| /** |