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

Side by Side Diff: chrome/browser/resources/bookmark_manager/js/bmm/bookmark_list.js

Issue 2350473003: Bookmark manager folder icon cleanups for list pane. (Closed)
Patch Set: Runtime check 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
« no previous file with comments | « chrome/browser/resources/bookmark_manager/css/bmm.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 /** @override */ 416 /** @override */
417 decorate: function() { 417 decorate: function() {
418 ListItem.prototype.decorate.call(this); 418 ListItem.prototype.decorate.call(this);
419 419
420 var bookmarkNode = this.bookmarkNode; 420 var bookmarkNode = this.bookmarkNode;
421 421
422 this.draggable = true; 422 this.draggable = true;
423 423
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 var labelImgWrapper = this.ownerDocument.createElement('div');
427 labelImgWrapper.className = 'label-img-wrapper';
428 var labelImg = this.ownerDocument.createElement('div');
429 var labelText = this.ownerDocument.createElement('div');
430 labelText.className = 'label-text';
431 labelText.textContent = bookmarkNode.title;
427 432
428 var urlEl = this.ownerDocument.createElement('div'); 433 var urlEl = this.ownerDocument.createElement('div');
429 urlEl.className = 'url'; 434 urlEl.className = 'url';
430 435
431 if (bmm.isFolder(bookmarkNode)) { 436 if (bmm.isFolder(bookmarkNode)) {
432 this.className = 'folder'; 437 this.className = 'folder';
438 // TODO(pkasting): Condense folder icon resources together.
439 labelImg.style.content = cr.icon.getImage(
440 cr.isMac ?
441 'chrome://theme/IDR_BOOKMARK_BAR_FOLDER' :
442 'chrome://theme/IDR_FOLDER_CLOSED');
433 } else { 443 } else {
434 labelEl.style.backgroundImage = cr.icon.getFavicon(bookmarkNode.url); 444 labelImg.style.content = cr.icon.getFavicon(bookmarkNode.url);
435 labelEl.style.backgroundSize = '16px';
436 urlEl.textContent = bookmarkNode.url; 445 urlEl.textContent = bookmarkNode.url;
437 } 446 }
438 447
448 labelImgWrapper.appendChild(labelImg);
449 labelEl.appendChild(labelImgWrapper);
450 labelEl.appendChild(labelText);
439 this.appendChild(labelEl); 451 this.appendChild(labelEl);
440 this.appendChild(urlEl); 452 this.appendChild(urlEl);
441 453
442 // Initially the ContextMenuButton was added here but it slowed down 454 // Initially the ContextMenuButton was added here but it slowed down
443 // rendering a lot so it is now added using mouseover. 455 // rendering a lot so it is now added using mouseover.
444 }, 456 },
445 457
446 /** 458 /**
447 * The ID of the bookmark folder we are currently showing or loading. 459 * The ID of the bookmark folder we are currently showing or loading.
448 * @type {string} 460 * @type {string}
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } 640 }
629 } 641 }
630 } 642 }
631 }; 643 };
632 644
633 return { 645 return {
634 BookmarkList: BookmarkList, 646 BookmarkList: BookmarkList,
635 list: /** @type {Element} */(null), // Set when decorated. 647 list: /** @type {Element} */(null), // Set when decorated.
636 }; 648 };
637 }); 649 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/bookmark_manager/css/bmm.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698