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

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

Issue 2805089: Add bookmark promo to NTP on first run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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.css ('k') | chrome/browser/tab_contents/web_contents_unittest.cc » ('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
===================================================================
--- chrome/browser/resources/new_new_tab.js (revision 52977)
+++ chrome/browser/resources/new_new_tab.js (working copy)
@@ -27,6 +27,12 @@
homepageButton.textContent = data[0].set_homepage_tip;
homepageButton.addEventListener('click', setAsHomePageLinkClicked);
return homepageButton;
+ } else if (data[0].set_promo_tip) {
+ var promoMessage = document.createElement('span');
+ promoMessage.innerHTML = data[0].set_promo_tip;
+ var promoButton = promoMessage.querySelector('button');
+ promoButton.addEventListener('click', importBookmarksLinkClicked);
+ return promoMessage;
} else {
try {
return parseHtmlSubset(data[0].tip_html_text);
@@ -441,14 +447,6 @@
actionLink.blur();
}
-function showFirstRunNotification() {
- showNotification(localStrings.getString('firstrunnotification'),
- localStrings.getString('closefirstrunnotification'),
- null, 30000);
- var notificationElement = $('notification');
- notification.classList.add('first-run');
-}
-
/**
* This handles the option menu.
* @param {Element} button The button element.
@@ -852,6 +850,11 @@
e.preventDefault();
}
+function importBookmarksLinkClicked(e) {
+ chrome.send('importBookmarks');
+ e.preventDefault();
+}
+
function onHomePageSet(data) {
showNotification(data[0], data[1]);
// Removes the "make this my home page" tip.
@@ -931,11 +934,6 @@
mostVisited.ensureSmallGridCorrect();
document.body.classList.remove('loading');
}, 1);
-
- // Only show the first run notification if first run.
- if (firstRun) {
- showFirstRunNotification();
- }
}
// Log clicked links from the tips section.
« no previous file with comments | « chrome/browser/resources/new_new_tab.css ('k') | chrome/browser/tab_contents/web_contents_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698