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

Unified Diff: chrome/browser/resources/local_ntp/local_ntp.js

Issue 14685004: Add finch flag for rendering a recently closed link on the local ntp. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 7 years, 7 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/local_ntp/local_ntp.html ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_ntp/local_ntp.js
diff --git a/chrome/browser/resources/local_ntp/local_ntp.js b/chrome/browser/resources/local_ntp/local_ntp.js
index 3d7825ecb30befc3eb8256a8e22be04b6f14e7ce..9aed3fedeac59eee3d3b0a2619747561d0c3c17d 100644
--- a/chrome/browser/resources/local_ntp/local_ntp.js
+++ b/chrome/browser/resources/local_ntp/local_ntp.js
@@ -39,6 +39,7 @@ var CLASSES = {
FAKEBOX_FOCUS: 'fakebox-focused', // Applies focus styles to the fakebox
FAVICON: 'mv-favicon',
GOOGLE_PAGE: 'google-page', // shows the Google logo and fakebox
+ HIDE_ATTRIBUTION: 'attribution-hide',
HIDE_BLACKLIST_BUTTON: 'mv-x-hide', // hides blacklist button during animation
HIDE_NOTIFICATION: 'mv-notice-hide',
HIDE_NTP: 'hide-ntp', // hides NTP and disables scrollbars
@@ -66,14 +67,17 @@ var CLASSES = {
var IDS = {
ACTIVE_SUGGESTIONS_CONTAINER: 'active-suggestions-container',
ATTRIBUTION: 'attribution',
+ ATTRIBUTION_TEXT: 'attribution-text',
CURSOR: 'cursor',
FAKEBOX: 'fakebox',
+ FOOTER: 'footer',
LOGO: 'logo',
NOTIFICATION: 'mv-notice',
NOTIFICATION_CLOSE_BUTTON: 'mv-notice-x',
NOTIFICATION_MESSAGE: 'mv-msg',
NTP_CONTENTS: 'ntp-contents',
PENDING_SUGGESTIONS_CONTAINER: 'pending-suggestions-container',
+ RECENT_TABS: 'recent-tabs',
RESTORE_ALL_LINK: 'mv-restore',
SUGGESTION_LOADER: 'suggestion-loader',
SUGGESTION_STYLE: 'suggestion-style',
@@ -326,7 +330,7 @@ function onThemeChange() {
*/
function updateAttribution(url) {
if (!url) {
- attribution.hidden = true;
+ attribution.classList.add(CLASSES.HIDE_ATTRIBUTION);
return;
}
var attributionImage = new Image();
@@ -335,10 +339,10 @@ function updateAttribution(url) {
if (oldAttributionImage)
removeNode(oldAttributionImage);
attribution.appendChild(attributionImage);
- attribution.hidden = false;
+ attribution.classList.remove(CLASSES.HIDE_ATTRIBUTION);
};
attributionImage.onerror = function() {
- attribution.hidden = true;
+ attribution.classList.add(CLASSES.HIDE_ATTRIBUTION);
};
attributionImage.src = url;
}
@@ -1609,6 +1613,17 @@ function init() {
ntpContents.insertBefore(logo, ntpContents.firstChild);
}
+ var recentTabsText = templateData.recentTabs;
+ if (recentTabsText) {
+ var recentTabsLink = document.createElement('span');
samarth 2013/05/15 16:49:17 Can this just be an <a href="chrome://history">? O
jeremycho 2013/05/16 20:06:47 It would add a non-functioning "Open link in new t
+ recentTabsLink.id = IDS.RECENT_TABS;
+ recentTabsLink.addEventListener('click', function() {
samarth 2013/05/15 16:49:17 Can you also add logic to look for a modifier and
jeremycho 2013/05/16 20:06:47 Done.
+ ntpApiHandle.navigateContentWindow('chrome://history');
+ });
+ recentTabsLink.textContent = recentTabsText;
+ var footer = $(IDS.FOOTER);
+ footer.insertBefore(recentTabsLink, footer.firstChild);
+ }
var notificationMessage = $(IDS.NOTIFICATION_MESSAGE);
notificationMessage.textContent = templateData.thumbnailRemovedNotification;
@@ -1618,7 +1633,7 @@ function init() {
var restoreAllLink = $(IDS.RESTORE_ALL_LINK);
restoreAllLink.addEventListener('click', onRestoreAll);
restoreAllLink.textContent = templateData.restoreThumbnailsShort;
- attribution.textContent = templateData.attributionIntro;
+ $(IDS.ATTRIBUTION_TEXT).textContent = templateData.attributionIntro;
var notificationCloseButton = $(IDS.NOTIFICATION_CLOSE_BUTTON);
notificationCloseButton.addEventListener('click', hideNotification);
« no previous file with comments | « chrome/browser/resources/local_ntp/local_ntp.html ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698