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 /** | 5 /** |
6 * @fileoverview The menu that shows tabs from sessions on other devices. | 6 * @fileoverview The menu that shows tabs from sessions on other devices. |
7 */ | 7 */ |
8 | 8 |
9 cr.define('ntp', function() { | 9 cr.define('ntp', function() { |
10 'use strict'; | 10 'use strict'; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Show a separator between multiple windows in the same session. | 205 // Show a separator between multiple windows in the same session. |
206 if (i > 0) | 206 if (i > 0) |
207 contents.appendChild(doc.createElement('hr')); | 207 contents.appendChild(doc.createElement('hr')); |
208 | 208 |
209 for (var j = 0; j < window.tabs.length; j++) { | 209 for (var j = 0; j < window.tabs.length; j++) { |
210 var tab = window.tabs[j]; | 210 var tab = window.tabs[j]; |
211 var a = doc.createElement('a'); | 211 var a = doc.createElement('a'); |
212 a.className = 'footer-menu-item'; | 212 a.className = 'footer-menu-item'; |
213 a.textContent = tab.title; | 213 a.textContent = tab.title; |
214 a.href = tab.url; | 214 a.href = tab.url; |
215 a.style.backgroundImage = url('chrome://session-favicon/' + tab.url); | 215 a.style.backgroundImage = |
| 216 getFaviconImageSet(tab.url, 16, /* session-favicon */ true); |
216 | 217 |
217 var clickHandler = this.makeClickHandler_( | 218 var clickHandler = this.makeClickHandler_( |
218 session.tag, String(window.sessionId), String(tab.sessionId)); | 219 session.tag, String(window.sessionId), String(tab.sessionId)); |
219 a.addEventListener('click', clickHandler); | 220 a.addEventListener('click', clickHandler); |
220 contents.appendChild(a); | 221 contents.appendChild(a); |
221 } | 222 } |
222 } | 223 } |
223 | 224 |
224 return contents; | 225 return contents; |
225 }, | 226 }, |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 updateMenuItems_: function() { | 350 updateMenuItems_: function() { |
350 this.collapseItem_.hidden = this.session_.collapsed; | 351 this.collapseItem_.hidden = this.session_.collapsed; |
351 this.expandItem_.hidden = !this.session_.collapsed; | 352 this.expandItem_.hidden = !this.session_.collapsed; |
352 } | 353 } |
353 }; | 354 }; |
354 | 355 |
355 return { | 356 return { |
356 OtherSessionsMenuButton: OtherSessionsMenuButton, | 357 OtherSessionsMenuButton: OtherSessionsMenuButton, |
357 }; | 358 }; |
358 }); | 359 }); |
OLD | NEW |