| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }); |
| OLD | NEW |