| 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 /** | 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 * something to occur until after a transition has completed. | 82 * something to occur until after a transition has completed. |
| 83 * @type {number} | 83 * @type {number} |
| 84 * @const | 84 * @const |
| 85 */ | 85 */ |
| 86 var DEFAULT_TRANSITION_TIME = 500; | 86 var DEFAULT_TRANSITION_TIME = 500; |
| 87 | 87 |
| 88 /** | 88 /** |
| 89 * Invoked at startup once the DOM is available to initialize the app. | 89 * Invoked at startup once the DOM is available to initialize the app. |
| 90 */ | 90 */ |
| 91 function initialize() { | 91 function initialize() { |
| 92 cr.enablePlatformSpecificCSSRules(); |
| 93 |
| 92 // Load the current theme colors. | 94 // Load the current theme colors. |
| 93 themeChanged(); | 95 themeChanged(); |
| 94 | 96 |
| 95 dotList = getRequiredElement('dot-list'); | 97 dotList = getRequiredElement('dot-list'); |
| 96 pageList = getRequiredElement('page-list'); | 98 pageList = getRequiredElement('page-list'); |
| 97 trash = getRequiredElement('trash'); | 99 trash = getRequiredElement('trash'); |
| 98 trash.hidden = true; | 100 trash.hidden = true; |
| 99 | 101 |
| 100 document.querySelector('#notification button').onclick = function(e) { | 102 document.querySelector('#notification button').onclick = function(e) { |
| 101 hideNotification(); | 103 hideNotification(); |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 // TODO(estade): update the content handlers to use ntp namespace instead of | 564 // TODO(estade): update the content handlers to use ntp namespace instead of |
| 563 // making these global. | 565 // making these global. |
| 564 var assert = ntp4.assert; | 566 var assert = ntp4.assert; |
| 565 var getAppsCallback = ntp4.getAppsCallback; | 567 var getAppsCallback = ntp4.getAppsCallback; |
| 566 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 568 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
| 567 var themeChanged = ntp4.themeChanged; | 569 var themeChanged = ntp4.themeChanged; |
| 568 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 570 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
| 569 var setMostVisitedPages = ntp4.setMostVisitedPages; | 571 var setMostVisitedPages = ntp4.setMostVisitedPages; |
| 570 | 572 |
| 571 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 573 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
| OLD | NEW |