Index: chrome/browser/resources/history/other_devices.js |
diff --git a/chrome/browser/resources/history/other_devices.js b/chrome/browser/resources/history/other_devices.js |
index 33e4bd46f33ae04f6c3853b023a0732a187630db..b8becff69fa2e35bf5fcdfb5a8f65529f2ab7434 100644 |
--- a/chrome/browser/resources/history/other_devices.js |
+++ b/chrome/browser/resources/history/other_devices.js |
@@ -427,6 +427,27 @@ DevicesView.prototype.increaseRowHeight = function(row, height) { |
// DevicesView, Private ------------------------------------------------------- |
/** |
+ * Provides an implementation for a single column grid. |
+ * @constructor |
+ * @implements {cr.ui.FocusRow.Observer} |
+ */ |
+DevicesView.SingleColumnObserver = function() {}; |
+ |
+DevicesView.SingleColumnObserver.prototype = { |
+ /** @override */ |
+ onActivate: function(row) {}, |
+ |
+ /** @override */ |
+ onDeactivate: function(row) {}, |
+ |
+ /** @override */ |
+ getRowElement: function(rowItem) { return rowItem; }, |
+ |
+ /** @override */ |
+ onElementIdMiss: function(row, expectedId) { return null; }, |
+}; |
+ |
+/** |
* Update the page with results. |
* @private |
*/ |
@@ -479,16 +500,19 @@ DevicesView.prototype.displayResults_ = function() { |
this.focusGrids_.forEach(function(grid) { grid.destroy(); }); |
this.focusGrids_.length = 0; |
- var singleColumn = function(e) { return [e]; }; |
- |
var devices = this.resultDiv_.querySelectorAll('.device-contents'); |
for (var i = 0; i < devices.length; ++i) { |
var rows = devices[i].querySelectorAll('.device-tab-entry, button'); |
if (!rows.length) |
continue; |
- var grid = new cr.ui.FocusGrid(devices[i]); |
- grid.setGrid(Array.prototype.map.call(rows, singleColumn)); |
+ var grid = new cr.ui.FocusGrid(devices[i], |
+ new DevicesView.SingleColumnObserver()); |
+ for (var j = 0; j < rows.length; ++j) { |
+ var row = grid.createRow(); |
+ row.setFocusableElementId(rows[j], 'single-column'); |
+ grid.addRow(row); |
+ } |
this.focusGrids_.push(grid); |
} |
}; |