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

Side by Side Diff: chrome/browser/resources/bookmark_manager/js/bmm/bookmark_list.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // TODO(arv): Now that this is driven by a data model, implement a data model 5 // TODO(arv): Now that this is driven by a data model, implement a data model
6 // that handles the loading and the events from the bookmark backend. 6 // that handles the loading and the events from the bookmark backend.
7 7
8 /** 8 /**
9 * @typedef {{childIds: Array<string>}} 9 * @typedef {{childIds: Array<string>}}
10 * 10 *
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 var labelEl = this.ownerDocument.createElement('div'); 424 var labelEl = this.ownerDocument.createElement('div');
425 labelEl.className = 'label'; 425 labelEl.className = 'label';
426 labelEl.textContent = bookmarkNode.title; 426 labelEl.textContent = bookmarkNode.title;
427 427
428 var urlEl = this.ownerDocument.createElement('div'); 428 var urlEl = this.ownerDocument.createElement('div');
429 urlEl.className = 'url'; 429 urlEl.className = 'url';
430 430
431 if (bmm.isFolder(bookmarkNode)) { 431 if (bmm.isFolder(bookmarkNode)) {
432 this.className = 'folder'; 432 this.className = 'folder';
433 } else { 433 } else {
434 labelEl.style.backgroundImage = cr.icon.getFaviconImageSet( 434 labelEl.style.backgroundImage = cr.icon.getFavicon(bookmarkNode.url);
435 bookmarkNode.url);
436 labelEl.style.backgroundSize = '16px'; 435 labelEl.style.backgroundSize = '16px';
437 urlEl.textContent = bookmarkNode.url; 436 urlEl.textContent = bookmarkNode.url;
438 } 437 }
439 438
440 this.appendChild(labelEl); 439 this.appendChild(labelEl);
441 this.appendChild(urlEl); 440 this.appendChild(urlEl);
442 441
443 // Initially the ContextMenuButton was added here but it slowed down 442 // Initially the ContextMenuButton was added here but it slowed down
444 // rendering a lot so it is now added using mouseover. 443 // rendering a lot so it is now added using mouseover.
445 }, 444 },
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 } 628 }
630 } 629 }
631 } 630 }
632 }; 631 };
633 632
634 return { 633 return {
635 BookmarkList: BookmarkList, 634 BookmarkList: BookmarkList,
636 list: /** @type {Element} */(null), // Set when decorated. 635 list: /** @type {Element} */(null), // Set when decorated.
637 }; 636 };
638 }); 637 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/history/history.js » ('j') | ios/web/webui/resources/web_ui_favicons.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698