Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/browser/resources/ntp4/new_tab.js

Issue 8045012: NotificationPromo (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Rename files to notification_promo.[h|cc] Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_page_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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('closeNotificationPromo');
219 }, 60000); 219 }, 60000);
220 chrome.send('notificationPromoViewed');
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
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);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/new_tab_page_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698