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

Side by Side Diff: chrome/browser/resources/history/other_devices.js

Issue 2280853002: Slightly nicer icon.js APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 for (var j = 0; j < win.tabs.length; j++) { 269 for (var j = 0; j < win.tabs.length; j++) {
270 var tab = win.tabs[j]; 270 var tab = win.tabs[j];
271 if (tab.hidden) 271 if (tab.hidden)
272 continue; 272 continue;
273 273
274 if (numTabsShown < maxNumTabs) { 274 if (numTabsShown < maxNumTabs) {
275 numTabsShown++; 275 numTabsShown++;
276 var a = createElementWithClassName('a', 'device-tab-entry'); 276 var a = createElementWithClassName('a', 'device-tab-entry');
277 a.href = tab.url; 277 a.href = tab.url;
278 a.style.backgroundImage = cr.icon.getFaviconImageSet(tab.url); 278 a.style.backgroundImage = cr.icon.getFavicon(tab.url);
279 this.addHighlightedText_(a, tab.title); 279 this.addHighlightedText_(a, tab.title);
280 // Add a tooltip, since it might be ellipsized. The ones that are not 280 // Add a tooltip, since it might be ellipsized. The ones that are not
281 // necessary will be removed once added to the document, so we can 281 // necessary will be removed once added to the document, so we can
282 // compute sizes. 282 // compute sizes.
283 a.title = tab.title; 283 a.title = tab.title;
284 284
285 // We need to use this to not lose the ids as we go through other loop 285 // We need to use this to not lose the ids as we go through other loop
286 // turns. 286 // turns.
287 function makeClickHandler(sessionTag, windowId, tabId) { 287 function makeClickHandler(sessionTag, windowId, tabId) {
288 return function(e) { 288 return function(e) {
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 devicesView.setSearchText($('search-field').value); 581 devicesView.setSearchText($('search-field').value);
582 }; 582 };
583 $('search-field').addEventListener('search', doSearch); 583 $('search-field').addEventListener('search', doSearch);
584 $('search-button').addEventListener('click', doSearch); 584 $('search-button').addEventListener('click', doSearch);
585 585
586 chrome.send('otherDevicesInitialized'); 586 chrome.send('otherDevicesInitialized');
587 } 587 }
588 588
589 // Add handlers to HTML elements. 589 // Add handlers to HTML elements.
590 document.addEventListener('DOMContentLoaded', load); 590 document.addEventListener('DOMContentLoaded', load);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698