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

Side by Side Diff: ios/chrome/app/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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698