| 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 = getFaviconImageSet(bookmarkNode.url); | 434 labelEl.style.backgroundImage = cr.icon.getFaviconImageSet( |
| 435 bookmarkNode.url); |
| 435 labelEl.style.backgroundSize = '16px'; | 436 labelEl.style.backgroundSize = '16px'; |
| 436 urlEl.textContent = bookmarkNode.url; | 437 urlEl.textContent = bookmarkNode.url; |
| 437 } | 438 } |
| 438 | 439 |
| 439 this.appendChild(labelEl); | 440 this.appendChild(labelEl); |
| 440 this.appendChild(urlEl); | 441 this.appendChild(urlEl); |
| 441 | 442 |
| 442 // Initially the ContextMenuButton was added here but it slowed down | 443 // Initially the ContextMenuButton was added here but it slowed down |
| 443 // rendering a lot so it is now added using mouseover. | 444 // rendering a lot so it is now added using mouseover. |
| 444 }, | 445 }, |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 } | 629 } |
| 629 } | 630 } |
| 630 } | 631 } |
| 631 }; | 632 }; |
| 632 | 633 |
| 633 return { | 634 return { |
| 634 BookmarkList: BookmarkList, | 635 BookmarkList: BookmarkList, |
| 635 list: /** @type {Element} */(null), // Set when decorated. | 636 list: /** @type {Element} */(null), // Set when decorated. |
| 636 }; | 637 }; |
| 637 }); | 638 }); |
| OLD | NEW |