| 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 New tab page | 6 * @fileoverview New tab page |
| 7 * This is the main code for the new tab page used by touch-enabled Chrome | 7 * This is the main code for the new tab page used by touch-enabled Chrome |
| 8 * browsers. For now this is still a prototype. | 8 * browsers. For now this is still a prototype. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 var menu = $('footer-menu-container'); | 327 var menu = $('footer-menu-container'); |
| 328 if (menu.clientWidth > logoImg.width) | 328 if (menu.clientWidth > logoImg.width) |
| 329 logo.style.WebkitFlex = '0 1 ' + menu.clientWidth + 'px'; | 329 logo.style.WebkitFlex = '0 1 ' + menu.clientWidth + 'px'; |
| 330 else | 330 else |
| 331 menu.style.WebkitFlex = '0 1 ' + logoImg.width + 'px'; | 331 menu.style.WebkitFlex = '0 1 ' + logoImg.width + 'px'; |
| 332 } | 332 } |
| 333 | 333 |
| 334 /** | 334 /** |
| 335 * Called when the theme has changed. | 335 * Called when the theme has changed. |
| 336 * @param {Object} opt_themeData Not used; only exists to match equivalent |
| 337 * function in incognito NTP. |
| 336 */ | 338 */ |
| 337 function themeChanged() { | 339 function themeChanged(opt_themeData) { |
| 338 $('themecss').href = 'chrome://theme/css/new_tab_theme.css?' + Date.now(); | 340 $('themecss').href = 'chrome://theme/css/new_tab_theme.css?' + Date.now(); |
| 339 } | 341 } |
| 340 | 342 |
| 341 function setBookmarkBarAttached(attached) { | 343 function setBookmarkBarAttached(attached) { |
| 342 document.documentElement.setAttribute('bookmarkbarattached', attached); | 344 document.documentElement.setAttribute('bookmarkbarattached', attached); |
| 343 } | 345 } |
| 344 | 346 |
| 345 /** | 347 /** |
| 346 * Timeout ID. | 348 * Timeout ID. |
| 347 * @type {number} | 349 * @type {number} |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 setFaviconDominantColor: setFaviconDominantColor, | 651 setFaviconDominantColor: setFaviconDominantColor, |
| 650 showNotification: showNotification, | 652 showNotification: showNotification, |
| 651 themeChanged: themeChanged, | 653 themeChanged: themeChanged, |
| 652 updateLogin: updateLogin | 654 updateLogin: updateLogin |
| 653 }; | 655 }; |
| 654 }); | 656 }); |
| 655 | 657 |
| 656 document.addEventListener('DOMContentLoaded', ntp.onLoad); | 658 document.addEventListener('DOMContentLoaded', ntp.onLoad); |
| 657 | 659 |
| 658 var toCssPx = cr.ui.toCssPx; | 660 var toCssPx = cr.ui.toCssPx; |
| OLD | NEW |