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

Unified Diff: chrome/browser/resources/new_new_tab.js

Issue 6825052: Update the web store promo to be clearer and configurable at run-time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate Aaron's feedback. Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | chrome/browser/resources/ntp/apps.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_new_tab.js
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 14dc2dc1839b9e09facfa194e0b22cfcbe6978f1..dd4c5a0204e23be8b5e36f27b1fdabe0725bd8d5 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -87,7 +87,7 @@ function addClosedMenuEntry(menu, url, title, imageUrl, opt_pingUrl) {
a.textContent = title;
a.style.backgroundImage = 'url(' + imageUrl + ')';
if (opt_pingUrl)
- a.setAttribute('ping', opt_pingUrl);
+ a.ping = opt_pingUrl;
addClosedMenuEntryWithLink(menu, a);
}
@@ -287,8 +287,8 @@ function createRecentItem(data) {
el = document.createElement('a');
el.className = 'item';
el.href = data.url;
- el.setAttribute('ping',
- getAppPingUrl('PING_BY_URL', data.url, 'NTP_RECENTLY_CLOSED'));
+ el.ping = getAppPingUrl(
+ 'PING_BY_URL', data.url, 'NTP_RECENTLY_CLOSED');
el.style.backgroundImage = url('chrome://favicon/' + data.url);
el.dir = data.direction;
el.textContent = data.title;
@@ -310,8 +310,8 @@ function addRecentMenuItem(menu, data) {
a.href = ''; // To make underline show up.
} else {
a.href = data.url;
- a.setAttribute('ping',
- getAppPingUrl('PING_BY_URL', data.url, 'NTP_RECENTLY_CLOSED'));
+ a.ping = getAppPingUrl(
+ 'PING_BY_URL', data.url, 'NTP_RECENTLY_CLOSED');
a.style.backgroundImage = 'url(chrome://favicon/' + data.url + ')';
a.textContent = data.title;
}
@@ -1076,13 +1076,6 @@ function hideNotification() {
}
}
-function showFirstRunNotification() {
- showNotification(localStrings.getString('firstrunnotification'),
- null, null, 30000);
- var notificationElement = $('notification');
- notification.classList.add('first-run');
-}
-
function showPromoNotification() {
showNotification(parseHtmlSubset(localStrings.getString('serverpromo')),
localStrings.getString('syncpromotext'),
@@ -1450,10 +1443,7 @@ function mostVisitedPages(data, firstRun, hasBlacklistedUrls) {
maybeDoneLoading();
}, 1);
- // Only show the first run notification if first run.
- if (firstRun) {
- showFirstRunNotification();
- } else if (localStrings.getString('serverpromo')) {
+ if (localStrings.getString('serverpromo')) {
showPromoNotification();
}
}
@@ -1467,12 +1457,10 @@ function isDoneLoading() {
return !document.body.classList.contains('loading');
}
-// Initialize the apps promo.
+// Initialize the listener for the "hide this" link on the apps promo. We do
+// this outside of getAppsCallback because it only needs to be done once per
+// NTP load.
document.addEventListener('DOMContentLoaded', function() {
- var promoLink = document.querySelector('#apps-promo-text1 a');
- promoLink.id = 'apps-promo-link';
- promoLink.href = localStrings.getString('web_store_url');
-
$('apps-promo-hide').addEventListener('click', function() {
chrome.send('hideAppsPromo', []);
document.documentElement.classList.remove('apps-promo-visible');
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | chrome/browser/resources/ntp/apps.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698