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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 for (var j = 0; j < win.tabs.length; j++) { | 257 for (var j = 0; j < win.tabs.length; j++) { |
258 var tab = win.tabs[j]; | 258 var tab = win.tabs[j]; |
259 if (tab.hidden) | 259 if (tab.hidden) |
260 continue; | 260 continue; |
261 | 261 |
262 if (numTabsShown < maxNumTabs) { | 262 if (numTabsShown < maxNumTabs) { |
263 numTabsShown++; | 263 numTabsShown++; |
264 var a = createElementWithClassName('a', 'device-tab-entry'); | 264 var a = createElementWithClassName('a', 'device-tab-entry'); |
265 a.href = tab.url; | 265 a.href = tab.url; |
266 a.style.backgroundImage = cr.icon.getFaviconImageSet(tab.url); | 266 a.style.backgroundImage = cr.icon.getFavicon(tab.url); |
267 this.addHighlightedText_(a, tab.title); | 267 this.addHighlightedText_(a, tab.title); |
268 // Add a tooltip, since it might be ellipsized. The ones that are not | 268 // Add a tooltip, since it might be ellipsized. The ones that are not |
269 // necessary will be removed once added to the document, so we can | 269 // necessary will be removed once added to the document, so we can |
270 // compute sizes. | 270 // compute sizes. |
271 a.title = tab.title; | 271 a.title = tab.title; |
272 | 272 |
273 // We need to use this to not lose the ids as we go through other loop | 273 // We need to use this to not lose the ids as we go through other loop |
274 // turns. | 274 // turns. |
275 function makeClickHandler(sessionTag, windowId, tabId) { | 275 function makeClickHandler(sessionTag, windowId, tabId) { |
276 return function(e) { | 276 return function(e) { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 devicesView.setSearchText($('search-field').value); | 566 devicesView.setSearchText($('search-field').value); |
567 }; | 567 }; |
568 $('search-field').addEventListener('search', doSearch); | 568 $('search-field').addEventListener('search', doSearch); |
569 $('search-button').addEventListener('click', doSearch); | 569 $('search-button').addEventListener('click', doSearch); |
570 | 570 |
571 chrome.send('otherDevicesInitialized'); | 571 chrome.send('otherDevicesInitialized'); |
572 } | 572 } |
573 | 573 |
574 // Add handlers to HTML elements. | 574 // Add handlers to HTML elements. |
575 document.addEventListener('DOMContentLoaded', load); | 575 document.addEventListener('DOMContentLoaded', load); |
OLD | NEW |