Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1907)

Unified Diff: chrome/browser/resources/extensions/extension_list.js

Issue 1128953004: Fix regression where rows could become non-focusable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/webui/resources/js/cr/ui/focus_grid.js » ('j') | ui/webui/resources/js/cr/ui/focus_grid.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0b3e4605be900579600d8f70e25979f9c1db02ab..327dd42bcb4f2cd4ca2ff269003214a3f4dc7411 100644
--- a/chrome/browser/resources/extensions/extension_list.js
+++ b/chrome/browser/resources/extensions/extension_list.js
@@ -273,14 +273,19 @@ cr.define('extensions', function() {
case EventType.ERROR_ADDED:
case EventType.ERRORS_REMOVED:
case EventType.PREFS_CHANGED:
- if (eventData.extensionInfo)
+ if (eventData.extensionInfo) {
this.updateExtension_(eventData.extensionInfo);
+ this.focusGrid_.ensureRowActive();
+ }
break;
case EventType.UNINSTALLED:
var index = this.getIndexOfExtension_(eventData.item_id);
this.extensions_.splice(index, 1);
var childNode = $(eventData.item_id);
childNode.parentNode.removeChild(childNode);
+ this.focusGrid_.removeRow(assertInstanceof(childNode,
+ ExtensionFocusRow));
+ this.focusGrid_.ensureRowActive();
break;
default:
assertNotReached();
@@ -389,9 +394,6 @@ cr.define('extensions', function() {
* @private
*/
showExtensionNodes_: function() {
- // Remove the rows from |focusGrid_| without destroying them.
- this.focusGrid_.rows.length = 0;
Dan Beam 2015/05/12 01:28:42 why could we just clear this but can't now?
hcarmona 2015/05/12 02:00:47 This function used to be called every time the gri
-
// Any node that is not updated will be removed.
var seenIds = [];
@@ -669,6 +671,10 @@ cr.define('extensions', function() {
// Maintain the order that nodes should be in when creating as well as
// when adding only one new row.
this.insertBefore(row, nextNode);
+ var nextRow = null;
+ if (nextNode)
+ nextRow = assertInstanceof(nextNode, ExtensionFocusRow);
+ this.focusGrid_.addRowBefore(row, nextRow);
this.updateNode_(extension, row);
Dan Beam 2015/05/12 01:28:42 needs more \n
hcarmona 2015/05/12 02:00:47 Done.
},
@@ -1025,7 +1031,6 @@ cr.define('extensions', function() {
}
row.updateFocusableElements();
- this.focusGrid_.addRow(row);
},
/**
« no previous file with comments | « no previous file | ui/webui/resources/js/cr/ui/focus_grid.js » ('j') | ui/webui/resources/js/cr/ui/focus_grid.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698