diff options
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r-- | chrome/browser/resources/new_new_tab.css | 1 | ||||
-rw-r--r-- | chrome/browser/resources/new_new_tab.js | 24 |
2 files changed, 12 insertions, 13 deletions
diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index a201da6..b842877 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -281,6 +281,7 @@ html[dir=rtl] .item { #tip-line button { /* We do not want a trailing single word from a link on the last line */ white-space: nowrap; + padding: 0; } #option-button { diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 5728d58..0274b9b7 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -27,6 +27,12 @@ function createTip(data) { 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 @@ function hideNotification() { 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 @@ function setAsHomePageLinkClicked(e) { 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 @@ function mostVisitedPages(data, firstRun) { 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. |