summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/ntp/most_visited.js
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 17:56:55 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-14 17:56:55 +0000
commit1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9 (patch)
treeac4c18a2820dc064739fceb824a9994795b783d3 /chrome/browser/resources/ntp/most_visited.js
parent90caf65af4eaa06b4c72bc22ba46363633b94029 (diff)
downloadchromium_src-1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9.zip
chromium_src-1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9.tar.gz
chromium_src-1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9.tar.bz2
Updates to NTP per UI review:
1) Turn off logo/attribution completely when it overlaps with the content. 2) Replace the single-item dropdown menu in the most visited section with a text link to restore blacklisted URLs. The link should only be visible if there are any blacklisted URLs. BUG=55196,55208 TEST=unit_tests --gtest-filter=TopSitesTest.* Review URL: http://codereview.chromium.org/3361015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59397 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/ntp/most_visited.js')
-rw-r--r--chrome/browser/resources/ntp/most_visited.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/resources/ntp/most_visited.js b/chrome/browser/resources/ntp/most_visited.js
index 5b024b2..c5f1967 100644
--- a/chrome/browser/resources/ntp/most_visited.js
+++ b/chrome/browser/resources/ntp/most_visited.js
@@ -104,6 +104,13 @@ var MostVisited = (function() {
this.data[sourceIndex] = destinationData;
},
+ updateSettingsLink: function(hasBlacklistedUrls) {
+ if (hasBlacklistedUrls)
+ $('most-visited-settings').classList.add('has-blacklist');
+ else
+ $('most-visited-settings').classList.remove('has-blacklist');
+ },
+
blacklist: function(el) {
var self = this;
var url = el.href;
@@ -126,7 +133,11 @@ var MostVisited = (function() {
// Send 'getMostVisitedPages' with a callback since we want to find the
// new page and add that in the place of the removed page.
- chromeSend('getMostVisited', [], 'mostVisitedPages', function(data) {
+ chromeSend('getMostVisited', [], 'mostVisitedPages',
+ function(data, firstRun, hasBlacklistedUrls) {
+ // Update settings link.
+ self.updateSettingsLink(hasBlacklistedUrls);
+
// Find new item.
var newItem;
for (var i = 0; i < data.length; i++) {