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

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

Issue 7461160: ntp4 info bubble (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: even more docs 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/new_tab.js
diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js
index 5c0ba441268fc69a1386d31e218ecd9e7bbf0f42..a16c3f510a40f420a44aee49aa3be45a7076de58 100644
--- a/chrome/browser/resources/ntp4/new_tab.js
+++ b/chrome/browser/resources/ntp4/new_tab.js
@@ -110,6 +110,14 @@ cr.define('ntp4', function() {
var highlightAppId = null;
/**
+ * If non-null, an info bubble for showing messages to the user. It points at
+ * the Most Visited label, and is used to draw more attention to the
+ * navigation dot UI.
+ * @type {!Element|undefined}
Rick Byers 2011/08/12 21:54:00 type doesn't match initialization to null before.
Evan Stade 2011/08/12 22:35:13 Done.
+ */
+ var infoBubble = null;
+
+ /**
* The time in milliseconds for most transitions. This should match what's
* in new_tab.css. Unfortunately there's no better way to try to time
* something to occur until after a transition has completed.
@@ -191,6 +199,15 @@ cr.define('ntp4', function() {
appendTilePage(mostVisitedPage, localStrings.getString('mostvisited'));
chrome.send('getMostVisited');
+ if (localStrings.getString('ntp4_intro_message')) {
+ infoBubble = new cr.ui.Bubble;
+ infoBubble.attach(mostVisitedPage.navigationDot);
+ infoBubble.setText(localStrings.getString('ntp4_intro_message'));
+ infoBubble.show();
+
+ chrome.send('introMessageSeen');
+ }
+
bookmarksPage = new ntp4.BookmarksPage();
appendTilePage(bookmarksPage, localStrings.getString('bookmarksPage'));
chrome.send('getBookmarks');
@@ -408,6 +425,8 @@ cr.define('ntp4', function() {
dotList.appendChild(newDot);
page.navigationDot = newDot;
+ if (infoBubble)
+ window.setTimeout(infoBubble.reposition.bind(infoBubble), 0);
eventTracker.add(page, 'pagelayout', onPageLayout);
}
@@ -596,9 +615,6 @@ cr.define('ntp4', function() {
} else if (page.classList.contains('bookmarks-page')) {
shownPage = templateData['bookmarks_page_id'];
shownPageIndex = 0;
- } else if (page.classList.contains('bookmarks-page')) {
- shownPage = templateData['bookmarks_page_id'];
- shownPageIndex = 0;
} else {
console.error('unknown page selected');
}

Powered by Google App Engine
This is Rietveld 408576698