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

Unified Diff: chrome/browser/resources/ntp4/most_visited_page.js

Issue 7481023: Adding notifications for new sync types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Now stores acknowledged types in a ListValue, not a StringValue. Created 9 years, 4 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
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 aeae1cda06ea42982bb2a2f228aec39433f10a83..9e6a908810926e137b97b41e276a553eadd5620c 100644
--- a/chrome/browser/resources/ntp4/most_visited_page.js
+++ b/chrome/browser/resources/ntp4/most_visited_page.js
@@ -278,6 +278,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);
}
@@ -286,6 +291,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;

Powered by Google App Engine
This is Rietveld 408576698