Index: chrome/browser/resources/ntp4/most_visited_page.js |
diff --git a/chrome/browser/resources/ntp4/most_visited_page.js b/chrome/browser/resources/ntp4/most_visited_page.js |
index a6631c8f75bd0fd4874d463dfa1e4d9596b7e9c1..58fdb3ef9d890a27366cf073fb34668392ab30ec 100644 |
--- a/chrome/browser/resources/ntp4/most_visited_page.js |
+++ b/chrome/browser/resources/ntp4/most_visited_page.js |
@@ -270,6 +270,11 @@ cr.define('ntp4', function() { |
if (!this.data_) { |
this.createTiles_(); |
this.data_ = data.slice(0, THUMBNAIL_COUNT); |
+ // Display the sync notification when the page is first initialized - we |
+ // don't want to display the notification multiple times, so we do this |
+ // here instead of refreshData(). |
+ if (templateData.syncnotification) |
+ this.showSyncNotification_(); |
} else { |
this.data_ = refreshData(this.data_, data); |
} |
@@ -278,6 +283,24 @@ cr.define('ntp4', function() { |
logEvent('mostVisited.layout: ' + (Date.now() - startTime)); |
}, |
+ /** |
+ * Displays a sync-related notification on the NTP. |
+ * @private |
+ */ |
+ showSyncNotification_: function() { |
+ var advancedOptionsLink = { |
+ action: function() { |
+ chrome.send('SyncTypeLinkClicked'); |
+ }, |
+ text: templateData.synclinktext |
+ }; |
+ ntp4.showNotification(templateData.syncnotification, |
+ [advancedOptionsLink], |
+ function() { |
+ chrome.send('closeSyncNotification'); |
+ }); |
+ }, |
+ |
/** @inheritDoc */ |
shouldAcceptDrag: function(e) { |
return false; |