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

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: arv review 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
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | chrome/browser/resources/shared/css/bubble.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8462398b7ab3594076cc735495dbc919e3dda500..03dbc03af78bdc55e86491267cd9901330dfebd3 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}
+ */
+ var infoBubble;
+
+ /**
* 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.
@@ -187,6 +195,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.anchorNode = mostVisitedPage.navigationDot;
+ infoBubble.text = localStrings.getString('ntp4_intro_message');
+ infoBubble.show();
+
+ chrome.send('introMessageSeen');
+ }
+
bookmarksPage = new ntp4.BookmarksPage();
appendTilePage(bookmarksPage, localStrings.getString('bookmarksPage'));
chrome.send('getBookmarks');
@@ -406,6 +423,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);
}
@@ -594,9 +613,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');
}
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.html ('k') | chrome/browser/resources/shared/css/bubble.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698