summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd16
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc39
-rw-r--r--chrome/browser/resources/new_new_tab.css10
-rw-r--r--chrome/browser/resources/new_new_tab.html1
-rw-r--r--chrome/browser/resources/new_new_tab.js17
5 files changed, 46 insertions, 37 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index a08529d..cb03483 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -3427,10 +3427,6 @@ each locale. -->
desc="Title of block that holds tips, suggestions, and other new information gathered from web resources in the new tab page.">
Recommendations
</message>
- <message name="IDS_NEW_TAB_EDIT_THUMBNAIL"
- desc="Link text for editing a thumbnail. Clicking this link allows the user to change the name and the URL of a thumbnail on the NTP.">
- edit
- </message>
<message name="IDS_NEW_TAB_RECENT_ACTIVITIES"
desc="Heading text for the section containing recent activities. Recent activies includes closed windows and tabs as well as downloads.">
Recent activities
@@ -3487,6 +3483,18 @@ each locale. -->
desc="Action link text to undo removing a thumbnail from the most visited section.">
Undo
</message>
+ <message name="IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP"
+ desc="Tooltip text for the button that removes/blacklists the thumbnail. Once removed the thumbnail will not show up on the new tab page again.">
+ Remove
+ </message>
+ <message name="IDS_NEW_TAB_PIN_THUMBNAIL_TOOLTIP"
+ desc="Tooltip text for the button that pins the thumbnail. Once pinned the thumbnail will always be shown on the new tab page and it will alwyas be shown in the same position.">
+ Pin
+ </message>
+ <message name="IDS_NEW_TAB_UNPIN_THUMBNAIL_TOOLTIP"
+ desc="Tooltip text for the button that unpins the thumbnail. Once unpinned the thumbnail might not be displayed on the new tab page any more.">
+ Unpin
+ </message>
<!-- SafeBrowsing -->
<message name="IDS_SAFE_BROWSING_MALWARE_TITLE" desc="SafeBrowsing Malware HTML title">
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 3bdb738..9f8b54d 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -295,38 +295,43 @@ void NewTabHTMLSource::StartDataRequest(const std::string& path,
l10n_util::GetString(IDS_NEW_TAB_ATTRIBUTION_INTRO));
localized_strings.SetString(L"resourcecache",
l10n_util::GetString(IDS_NEW_TAB_WEB_RESOURCE_CACHE));
- localized_strings.SetString(L"editthumbnail",
- l10n_util::GetString(IDS_NEW_TAB_EDIT_THUMBNAIL));
localized_strings.SetString(L"recentactivities",
- l10n_util::GetString(IDS_NEW_TAB_RECENT_ACTIVITIES));
+ l10n_util::GetString(IDS_NEW_TAB_RECENT_ACTIVITIES));
localized_strings.SetString(L"downloads",
- l10n_util::GetString(IDS_NEW_TAB_DOWNLOADS));
+ l10n_util::GetString(IDS_NEW_TAB_DOWNLOADS));
localized_strings.SetString(L"viewfullhistory",
- l10n_util::GetString(IDS_NEW_TAB_VIEW_FULL_HISTORY));
+ l10n_util::GetString(IDS_NEW_TAB_VIEW_FULL_HISTORY));
localized_strings.SetString(L"viewalldownloads",
- l10n_util::GetString(IDS_NEW_TAB_VIEW_ALL_DOWNLOADS));
+ l10n_util::GetString(IDS_NEW_TAB_VIEW_ALL_DOWNLOADS));
localized_strings.SetString(L"showthumbnails",
- l10n_util::GetString(IDS_NEW_TAB_SHOW_THUMBNAILS));
+ l10n_util::GetString(IDS_NEW_TAB_SHOW_THUMBNAILS));
localized_strings.SetString(L"hidethumbnails",
- l10n_util::GetString(IDS_NEW_TAB_HIDE_THUMBNAILS));
+ l10n_util::GetString(IDS_NEW_TAB_HIDE_THUMBNAILS));
localized_strings.SetString(L"showlist",
- l10n_util::GetString(IDS_NEW_TAB_SHOW_LIST));
+ l10n_util::GetString(IDS_NEW_TAB_SHOW_LIST));
localized_strings.SetString(L"hidelist",
- l10n_util::GetString(IDS_NEW_TAB_HIDE_LIST));
+ l10n_util::GetString(IDS_NEW_TAB_HIDE_LIST));
localized_strings.SetString(L"showrecent",
- l10n_util::GetString(IDS_NEW_TAB_SHOW_RECENT));
+ l10n_util::GetString(IDS_NEW_TAB_SHOW_RECENT));
localized_strings.SetString(L"hiderecent",
- l10n_util::GetString(IDS_NEW_TAB_HIDE_RECENT));
+ l10n_util::GetString(IDS_NEW_TAB_HIDE_RECENT));
localized_strings.SetString(L"showrecommendations",
- l10n_util::GetString(IDS_NEW_TAB_SHOW_RECOMMENDATIONS));
+ l10n_util::GetString(IDS_NEW_TAB_SHOW_RECOMMENDATIONS));
localized_strings.SetString(L"hiderecommendations",
- l10n_util::GetString(IDS_NEW_TAB_HIDE_RECOMMENDATIONS));
+ l10n_util::GetString(IDS_NEW_TAB_HIDE_RECOMMENDATIONS));
localized_strings.SetString(L"thumbnailremovednotification",
- l10n_util::GetString(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION));
+ l10n_util::GetString(IDS_NEW_TAB_THUMBNAIL_REMOVED_NOTIFICATION));
localized_strings.SetString(L"undothumbnailremove",
- l10n_util::GetString(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE));
+ l10n_util::GetString(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE));
localized_strings.SetString(L"otrmessage",
- l10n_util::GetString(IDS_NEW_TAB_OTR_MESSAGE));
+ l10n_util::GetString(IDS_NEW_TAB_OTR_MESSAGE));
+ localized_strings.SetString(L"removethumbnailtooltip",
+ l10n_util::GetString(IDS_NEW_TAB_REMOVE_THUMBNAIL_TOOLTIP));
+ localized_strings.SetString(L"pinthumbnailtooltip",
+ l10n_util::GetString(IDS_NEW_TAB_PIN_THUMBNAIL_TOOLTIP));
+ localized_strings.SetString(L"unpinthumbnailtooltip",
+ l10n_util::GetString(IDS_NEW_TAB_UNPIN_THUMBNAIL_TOOLTIP));
+
SetFontAndTextDirection(&localized_strings);
diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css
index 8f40fe3..c7cac8a 100644
--- a/chrome/browser/resources/new_new_tab.css
+++ b/chrome/browser/resources/new_new_tab.css
@@ -167,16 +167,6 @@ html[anim='false'] *,
pointer-events: inherit;
}
-.edit-bar {
-
-}
-
-.edit-bar > .edit-link {
- padding: 0 5px;
- color: hsl(213, 88%, 94%);
- font-weight: bold;
-}
-
.edit-bar > .spacer {
-webkit-box-flex: 1;
}
diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html
index 76823be..52a684c 100644
--- a/chrome/browser/resources/new_new_tab.html
+++ b/chrome/browser/resources/new_new_tab.html
@@ -82,7 +82,6 @@ logEvent('log start');
<div class="edit-bar">
<div class="pin"></div>
<div class="spacer"></div>
- <div class="edit-link link"></div>
<div class="remove"></div>
</div>
<span class="thumbnail-wrapper">
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js
index 033c7f2..14fa721 100644
--- a/chrome/browser/resources/new_new_tab.js
+++ b/chrome/browser/resources/new_new_tab.js
@@ -244,8 +244,10 @@ function renderMostVisited(data) {
t.className = getThumbnailClassName(d);
t.title = d.title;
t.href = d.url;
- t.querySelector('.edit-link').textContent =
- localStrings.getString('editthumbnail');
+ t.querySelector('.pin').title = localStrings.getString(d.pinned ?
+ 'unpinthumbnailtooltip' : 'pinthumbnailtooltip');
+ t.querySelector('.remove').title =
+ localStrings.getString('removethumbnailtooltip');
// There was some concern that a malformed malicious URL could cause an XSS
// attack but setting style.backgroundImage = 'url(javascript:...)' does
@@ -395,6 +397,9 @@ var mostVisited = {
chrome.send('addPinnedURL', [data.url, data.title, String(index)]);
}
data.pinned = !data.pinned;
+ // Update tooltip
+ el.querySelector('.pin').title = localStrings.getString(data.pinned ?
+ 'unpinthumbnailtooltip' : 'pinthumbnailtooltip');
},
getThumbnailIndex: function(el) {
@@ -506,6 +511,11 @@ var mostVisited = {
thumbCheckbox.checked = false;
listCheckbox.checked = false;
}
+
+ thumbCheckbox.title = localStrings.getString(
+ shownSections & Section.THUMB ? 'hidethumbnails' : 'showthumbnails');
+ listCheckbox.title = localStrings.getString(
+ shownSections & Section.LIST ? 'hidelist' : 'showlist');
}
};
@@ -853,9 +863,6 @@ $('most-visited').addEventListener('click', function(e) {
} else if (hasClass(target, 'remove')) {
mostVisited.blacklist(mostVisited.getItem(target));
e.preventDefault();
- } else if (hasClass(target, 'edit-link')) {
- alert('Not implemented yet')
- e.preventDefault();
}
});