| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 The section of the history page that shows tabs from sessions | 6 * @fileoverview The section of the history page that shows tabs from sessions |
| 7 on other devices. | 7 on other devices. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /////////////////////////////////////////////////////////////////////////////// | 10 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 this.focusGrids_.forEach(function(grid) { grid.destroy(); }); | 506 this.focusGrids_.forEach(function(grid) { grid.destroy(); }); |
| 507 this.focusGrids_.length = 0; | 507 this.focusGrids_.length = 0; |
| 508 | 508 |
| 509 var devices = this.resultDiv_.querySelectorAll('.device-contents'); | 509 var devices = this.resultDiv_.querySelectorAll('.device-contents'); |
| 510 for (var i = 0; i < devices.length; ++i) { | 510 for (var i = 0; i < devices.length; ++i) { |
| 511 var rows = devices[i].querySelectorAll('.device-tab-entry, button'); | 511 var rows = devices[i].querySelectorAll('.device-tab-entry, button'); |
| 512 if (!rows.length) | 512 if (!rows.length) |
| 513 continue; | 513 continue; |
| 514 | 514 |
| 515 var grid = new cr.ui.FocusGrid(); | 515 var grid = new cr.ui.FocusGrid(); |
| 516 for (var i = 0; i < rows.length; ++i) { | 516 for (var j = 0; j < rows.length; ++j) { |
| 517 DevicesViewFocusRow.decorate(rows[i], devices[i]); | 517 DevicesViewFocusRow.decorate(rows[j], devices[i]); |
| 518 grid.addRow(rows[i]); | 518 grid.addRow(rows[j]); |
| 519 } | 519 } |
| 520 this.focusGrids_.push(grid); | 520 this.focusGrids_.push(grid); |
| 521 } | 521 } |
| 522 }; | 522 }; |
| 523 | 523 |
| 524 /** | 524 /** |
| 525 * Sets the menu model data. An empty list means that either there are no | 525 * Sets the menu model data. An empty list means that either there are no |
| 526 * foreign sessions, or tab sync is disabled for this profile. | 526 * foreign sessions, or tab sync is disabled for this profile. |
| 527 * |isTabSyncEnabled| makes it possible to distinguish between the cases. | 527 * |isTabSyncEnabled| makes it possible to distinguish between the cases. |
| 528 * | 528 * |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 | 578 |
| 579 var doSearch = function(e) { | 579 var doSearch = function(e) { |
| 580 devicesView.setSearchText($('search-field').value); | 580 devicesView.setSearchText($('search-field').value); |
| 581 }; | 581 }; |
| 582 $('search-field').addEventListener('search', doSearch); | 582 $('search-field').addEventListener('search', doSearch); |
| 583 $('search-button').addEventListener('click', doSearch); | 583 $('search-button').addEventListener('click', doSearch); |
| 584 } | 584 } |
| 585 | 585 |
| 586 // Add handlers to HTML elements. | 586 // Add handlers to HTML elements. |
| 587 document.addEventListener('DOMContentLoaded', load); | 587 document.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |