| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 chrome.send('introMessageSeen'); | 208 chrome.send('introMessageSeen'); |
| 209 } | 209 } |
| 210 | 210 |
| 211 bookmarksPage = new ntp4.BookmarksPage(); | 211 bookmarksPage = new ntp4.BookmarksPage(); |
| 212 appendTilePage(bookmarksPage, localStrings.getString('bookmarksPage')); | 212 appendTilePage(bookmarksPage, localStrings.getString('bookmarksPage')); |
| 213 chrome.send('getBookmarksData'); | 213 chrome.send('getBookmarksData'); |
| 214 | 214 |
| 215 var serverpromo = localStrings.getString('serverpromo'); | 215 var serverpromo = localStrings.getString('serverpromo'); |
| 216 if (serverpromo) { | 216 if (serverpromo) { |
| 217 showNotification(parseHtmlSubset(serverpromo), [], function() { | 217 showNotification(parseHtmlSubset(serverpromo), [], function() { |
| 218 chrome.send('closePromo'); | 218 chrome.send('closePromoNotification'); |
| 219 }, 60000); | 219 }, 60000); |
| 220 chrome.send('promoNotificationViewed'); |
| 220 } | 221 } |
| 221 } | 222 } |
| 222 | 223 |
| 223 /** | 224 /** |
| 224 * Simple common assertion API | 225 * Simple common assertion API |
| 225 * @param {*} condition The condition to test. Note that this may be used to | 226 * @param {*} condition The condition to test. Note that this may be used to |
| 226 * test whether a value is defined or not, and we don't want to force a | 227 * test whether a value is defined or not, and we don't want to force a |
| 227 * cast to Boolean. | 228 * cast to Boolean. |
| 228 * @param {string=} opt_message A message to use in any error. | 229 * @param {string=} opt_message A message to use in any error. |
| 229 */ | 230 */ |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 var assert = ntp4.assert; | 863 var assert = ntp4.assert; |
| 863 var getAppsCallback = ntp4.getAppsCallback; | 864 var getAppsCallback = ntp4.getAppsCallback; |
| 864 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; | 865 var appsPrefChangeCallback = ntp4.appsPrefChangeCallback; |
| 865 var themeChanged = ntp4.themeChanged; | 866 var themeChanged = ntp4.themeChanged; |
| 866 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; | 867 var recentlyClosedTabs = ntp4.setRecentlyClosedTabs; |
| 867 var setMostVisitedPages = ntp4.setMostVisitedPages; | 868 var setMostVisitedPages = ntp4.setMostVisitedPages; |
| 868 | 869 |
| 869 document.addEventListener('DOMContentLoaded', ntp4.initialize); | 870 document.addEventListener('DOMContentLoaded', ntp4.initialize); |
| 870 window.addEventListener('online', ntp4.updateOfflineEnabledApps); | 871 window.addEventListener('online', ntp4.updateOfflineEnabledApps); |
| 871 window.addEventListener('offline', ntp4.updateOfflineEnabledApps); | 872 window.addEventListener('offline', ntp4.updateOfflineEnabledApps); |
| OLD | NEW |