Chromium Code Reviews| Index: chrome/browser/resources/extensions/extension_list.js |
| diff --git a/chrome/browser/resources/extensions/extension_list.js b/chrome/browser/resources/extensions/extension_list.js |
| index f6967bd6297656b638d75cb63c44064ba79773fc..91a7e13d14dec3e53796d36de2114bee44b07cfb 100644 |
| --- a/chrome/browser/resources/extensions/extension_list.js |
| +++ b/chrome/browser/resources/extensions/extension_list.js |
| @@ -285,11 +285,28 @@ cr.define('extensions', function() { |
| this.extensions_ = extensions; |
| this.showExtensionNodes_(); |
| resolve(); |
| + this.extensionsUpdated_.then(this.onUpdateFinished_.bind(this)); |
|
not at google - send to devlin
2015/04/14 23:35:25
Since the promise has already resolved, this shoul
hcarmona
2015/04/14 23:49:06
|resolve| is async and it's important that |onUpda
not at google - send to devlin
2015/04/14 23:56:22
Mind... blown. Maybe add a comment. Are you sure t
|
| }.bind(this)); |
| }.bind(this)); |
| return this.extensionsUpdated_; |
| }, |
| + /** Updates any element that needs to be visible to update properly. */ |
| + onUpdateFinished_: function() { |
| + assert(!this.hidden); |
| + assert(!this.parentElement.hidden); |
| + |
| + this.updateFocusableElements(); |
| + |
| + var idToHighlight = this.getIdQueryParam_(); |
| + if (idToHighlight && $(idToHighlight)) |
| + this.scrollToNode_(idToHighlight); |
| + |
| + var idToOpenOptions = this.getOptionsQueryParam_(); |
| + if (idToOpenOptions && $(idToOpenOptions)) |
| + this.showEmbeddedExtensionOptions_(idToOpenOptions, true); |
| + }, |
| + |
| /** @return {number} The number of extensions being displayed. */ |
| getNumExtensions: function() { |
| return this.extensions_.length; |
| @@ -339,14 +356,6 @@ cr.define('extensions', function() { |
| assertInstanceof(node, ExtensionFocusRow).destroy(); |
| } |
| } |
| - |
| - var idToHighlight = this.getIdQueryParam_(); |
| - if (idToHighlight && $(idToHighlight)) |
| - this.scrollToNode_(idToHighlight); |
| - |
| - var idToOpenOptions = this.getOptionsQueryParam_(); |
| - if (idToOpenOptions && $(idToOpenOptions)) |
| - this.showEmbeddedExtensionOptions_(idToOpenOptions, true); |
| }, |
| /** Updates each row's focusable elements without rebuilding the grid. */ |