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

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

Issue 10832196: [extensions] Don't let clicks on <a href="#"> links escape un-prevented. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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
OLDNEW
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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 }; 205 };
206 showNotification(parseHtmlSubset(promo, tags, attrs), [], function() { 206 showNotification(parseHtmlSubset(promo, tags, attrs), [], function() {
207 chrome.send('closeNotificationPromo'); 207 chrome.send('closeNotificationPromo');
208 }, 60000); 208 }, 60000);
209 chrome.send('notificationPromoViewed'); 209 chrome.send('notificationPromoViewed');
210 } 210 }
211 211
212 cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true); 212 cr.dispatchSimpleEvent(document, 'ntpLoaded', true, true);
213 document.documentElement.classList.remove('starting-up'); 213 document.documentElement.classList.remove('starting-up');
214 }); 214 });
215
216 preventDefaultOnPoundLinkClicks(); // From shared/js/util.js.
215 } 217 }
216 218
217 /** 219 /**
218 * Launches the chrome web store app with the chrome-ntp-launcher 220 * Launches the chrome web store app with the chrome-ntp-launcher
219 * source. 221 * source.
220 * @param {Event} e The click event. 222 * @param {Event} e The click event.
221 */ 223 */
222 function onChromeWebStoreButtonClick(e) { 224 function onChromeWebStoreButtonClick(e) {
223 chrome.send('recordAppLaunchByURL', 225 chrome.send('recordAppLaunchByURL',
224 [encodeURIComponent(this.href), 226 [encodeURIComponent(this.href),
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 setStripeColor: setStripeColor, 588 setStripeColor: setStripeColor,
587 showNotification: showNotification, 589 showNotification: showNotification,
588 themeChanged: themeChanged, 590 themeChanged: themeChanged,
589 updateLogin: updateLogin 591 updateLogin: updateLogin
590 }; 592 };
591 }); 593 });
592 594
593 document.addEventListener('DOMContentLoaded', ntp.onLoad); 595 document.addEventListener('DOMContentLoaded', ntp.onLoad);
594 596
595 var toCssPx = cr.ui.toCssPx; 597 var toCssPx = cr.ui.toCssPx;
OLDNEW
« no previous file with comments | « chrome/browser/resources/extensions/extensions.js ('k') | chrome/browser/resources/shared/js/util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698