OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 cr.define('ntp4', function() { | 5 cr.define('ntp4', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var localStrings = new LocalStrings; | 8 var localStrings = new LocalStrings; |
9 | 9 |
10 /** | 10 /** |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 /** | 61 /** |
62 * Initialize the bookmark object. | 62 * Initialize the bookmark object. |
63 */ | 63 */ |
64 initialize: function() { | 64 initialize: function() { |
65 var id = tileId++; | 65 var id = tileId++; |
66 this.id = 'bookmark_tile_' + id; | 66 this.id = 'bookmark_tile_' + id; |
67 | 67 |
68 var title = this.querySelector('.title'); | 68 var title = this.querySelector('.title'); |
69 title.textContent = this.data.title; | 69 title.textContent = this.data.title; |
70 | 70 |
| 71 // Sets the tooltip. |
| 72 this.title = this.data.title; |
| 73 |
71 if (this.data.url) { | 74 if (this.data.url) { |
72 var button = this.querySelector('.button'); | 75 var button = this.querySelector('.button'); |
73 button.href = title.href = this.data.url; | 76 button.href = title.href = this.data.url; |
74 } | 77 } |
75 | 78 |
76 var faviconDiv = this.querySelector('.favicon'); | 79 var faviconDiv = this.querySelector('.favicon'); |
77 var faviconUrl; | 80 var faviconUrl; |
78 if (this.data.url) { | 81 if (this.data.url) { |
79 faviconUrl = 'chrome://favicon/size/16/' + this.data.url; | 82 faviconUrl = 'chrome://favicon/size/16/' + this.data.url; |
80 chrome.send('getFaviconDominantColor', [faviconUrl, this.id]); | 83 chrome.send('getFaviconDominantColor', [faviconUrl, this.id]); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 tile.stripeColor = color; | 596 tile.stripeColor = color; |
594 } | 597 } |
595 | 598 |
596 return { | 599 return { |
597 BookmarksPage: BookmarksPage, | 600 BookmarksPage: BookmarksPage, |
598 initBookmarkChevron: initBookmarkChevron, | 601 initBookmarkChevron: initBookmarkChevron, |
599 }; | 602 }; |
600 }); | 603 }); |
601 | 604 |
602 window.addEventListener('load', ntp4.initBookmarkChevron); | 605 window.addEventListener('load', ntp4.initBookmarkChevron); |
OLD | NEW |