| 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 cr.define('bmm', function() { | 8 cr.define('bmm', function() { |
| 9 var List = cr.ui.List; | 9 var List = cr.ui.List; |
| 10 var ListItem = cr.ui.ListItem; | 10 var ListItem = cr.ui.ListItem; |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 var labelEl = this.ownerDocument.createElement('div'); | 382 var labelEl = this.ownerDocument.createElement('div'); |
| 383 labelEl.className = 'label'; | 383 labelEl.className = 'label'; |
| 384 labelEl.textContent = bookmarkNode.title; | 384 labelEl.textContent = bookmarkNode.title; |
| 385 | 385 |
| 386 var urlEl = this.ownerDocument.createElement('div'); | 386 var urlEl = this.ownerDocument.createElement('div'); |
| 387 urlEl.className = 'url'; | 387 urlEl.className = 'url'; |
| 388 | 388 |
| 389 if (bmm.isFolder(bookmarkNode)) { | 389 if (bmm.isFolder(bookmarkNode)) { |
| 390 this.className = 'folder'; | 390 this.className = 'folder'; |
| 391 } else { | 391 } else { |
| 392 labelEl.style.backgroundImage = url('chrome://favicon/' + | 392 labelEl.style.backgroundImage = url(getFaviconURL(bookmarkNode.url)); |
| 393 bookmarkNode.url); | 393 labelEl.style.backgroundSize = '16px'; |
| 394 urlEl.textContent = bookmarkNode.url; | 394 urlEl.textContent = bookmarkNode.url; |
| 395 } | 395 } |
| 396 | 396 |
| 397 this.appendChild(labelEl); | 397 this.appendChild(labelEl); |
| 398 this.appendChild(urlEl); | 398 this.appendChild(urlEl); |
| 399 | 399 |
| 400 // Initially the ContextMenuButton was added here but it slowed down | 400 // Initially the ContextMenuButton was added here but it slowed down |
| 401 // rendering a lot so it is now added using mouseover. | 401 // rendering a lot so it is now added using mouseover. |
| 402 }, | 402 }, |
| 403 | 403 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 } | 566 } |
| 567 } | 567 } |
| 568 } | 568 } |
| 569 }; | 569 }; |
| 570 | 570 |
| 571 return { | 571 return { |
| 572 BookmarkList: BookmarkList, | 572 BookmarkList: BookmarkList, |
| 573 list: list | 573 list: list |
| 574 }; | 574 }; |
| 575 }); | 575 }); |
| OLD | NEW |