Index: chrome/browser/resources/ntp_search/new_tab.js |
diff --git a/chrome/browser/resources/ntp_search/new_tab.js b/chrome/browser/resources/ntp_search/new_tab.js |
index 4989c82558e42eeb9f7df6ada55420203c5190aa..b3bc74f6d2db4ff2193c17c9370f90f88d486aa3 100644 |
--- a/chrome/browser/resources/ntp_search/new_tab.js |
+++ b/chrome/browser/resources/ntp_search/new_tab.js |
@@ -943,10 +943,9 @@ cr.define('ntp', function() { |
document.addEventListener('dragstart', closeFunc); |
notificationContainer.hidden = false; |
- showNotificationOnCurrentPage(); |
- |
- newTabView.cardSlider.frame.addEventListener( |
- 'cardSlider:card_change_ended', onCardChangeEnded); |
+ window.setTimeout(function() { |
+ notificationContainer.classList.remove('inactive'); |
+ }, 0); |
var timeout = opt_timeout || 10000; |
notificationTimeout = window.setTimeout(hideNotification, timeout); |
@@ -957,47 +956,6 @@ cr.define('ntp', function() { |
*/ |
function hideNotification() { |
notificationContainer.classList.add('inactive'); |
- |
- newTabView.cardSlider.frame.removeEventListener( |
- 'cardSlider:card_change_ended', onCardChangeEnded); |
- } |
- |
- /** |
- * Happens when 1 or more consecutive card changes end. |
- * @param {Event} e The cardSlider:card_change_ended event. |
- */ |
- function onCardChangeEnded(e) { |
- // If we ended on the same page as we started, ignore. |
- if (newTabView.cardSlider.currentCardValue.notification) |
- return; |
- |
- // Hide the notification the old page. |
- notificationContainer.classList.add('card-changed'); |
- |
- showNotificationOnCurrentPage(); |
- } |
- |
- /** |
- * Move and show the notification on the current page. |
- */ |
- function showNotificationOnCurrentPage() { |
- var page = newTabView.cardSlider.currentCardValue; |
- doWhenAllSectionsReady(function() { |
- if (page != newTabView.cardSlider.currentCardValue) |
- return; |
- |
- // NOTE: This moves the notification to inside of the current page. |
- page.notification = notificationContainer; |
- |
- // Reveal the notification and instruct it to hide itself if ignored. |
- notificationContainer.classList.remove('inactive'); |
- |
- // Gives the browser time to apply this rule before we remove it (causing |
- // a transition). |
- window.setTimeout(function() { |
- notificationContainer.classList.remove('card-changed'); |
- }, 0); |
- }); |
} |
/** |
@@ -1011,11 +969,11 @@ cr.define('ntp', function() { |
} |
function setRecentlyClosedTabs(data) { |
- newTabView.recentlyClosedPage.data = data; |
+ newTabView.recentlyClosedPage.setData(data); |
} |
function setMostVisitedPages(data, hasBlacklistedUrls) { |
- newTabView.mostVisitedPage.data = data; |
+ newTabView.mostVisitedPage.setData(data); |
cr.dispatchSimpleEvent(document, 'sectionready', true, true); |
} |