diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 17:56:55 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-14 17:56:55 +0000 |
commit | 1d95a8f0e313c9afbfd56fa0c007a16ad3881ba9 (patch) | |
tree | ac4c18a2820dc064739fceb824a9994795b783d3 /chrome/browser/history | |
parent | 90caf65af4eaa06b4c72bc22ba46363633b94029 (diff) | |
download | chromium_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/history')
-rw-r--r-- | chrome/browser/history/top_sites.cc | 5 | ||||
-rw-r--r-- | chrome/browser/history/top_sites.h | 3 | ||||
-rw-r--r-- | chrome/browser/history/top_sites_unittest.cc | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/history/top_sites.cc b/chrome/browser/history/top_sites.cc index 2825fff..d746e43 100644 --- a/chrome/browser/history/top_sites.cc +++ b/chrome/browser/history/top_sites.cc @@ -669,6 +669,11 @@ void TopSites::StartMigration() { MigratePinnedURLs(); } +bool TopSites::HasBlacklistedItems() const { + AutoLock lock(lock_); + return !blacklist_->empty(); +} + void TopSites::AddBlacklistedURL(const GURL& url) { AutoLock lock(lock_); RemovePinnedURLLocked(url); diff --git a/chrome/browser/history/top_sites.h b/chrome/browser/history/top_sites.h index 81884d7..1b57a61 100644 --- a/chrome/browser/history/top_sites.h +++ b/chrome/browser/history/top_sites.h @@ -102,6 +102,9 @@ class TopSites : // Blacklisted URLs + // Returns true if there is at least one item in the blacklist. + bool HasBlacklistedItems() const; + // Add a URL to the blacklist. void AddBlacklistedURL(const GURL& url); diff --git a/chrome/browser/history/top_sites_unittest.cc b/chrome/browser/history/top_sites_unittest.cc index 360cd0d..c327647 100644 --- a/chrome/browser/history/top_sites_unittest.cc +++ b/chrome/browser/history/top_sites_unittest.cc @@ -1140,8 +1140,10 @@ TEST_F(TopSitesTest, Blacklisting) { EXPECT_EQ("http://google.com/", urls()[1].url.spec()); EXPECT_EQ(welcome_url(), urls()[2].url); EXPECT_EQ(themes_url(), urls()[3].url); + EXPECT_FALSE(top_sites().HasBlacklistedItems()); top_sites().AddBlacklistedURL(GURL("http://google.com/")); + EXPECT_TRUE(top_sites().HasBlacklistedItems()); { Lock& l = lock(); AutoLock lock(l); // IsBlacklisted must be in a lock. @@ -1162,6 +1164,7 @@ TEST_F(TopSitesTest, Blacklisting) { EXPECT_EQ(themes_url(), urls()[2].url); top_sites().AddBlacklistedURL(welcome_url()); + EXPECT_TRUE(top_sites().HasBlacklistedItems()); top_sites().GetMostVisitedURLs( &c, NewCallback(static_cast<TopSitesTest*>(this), @@ -1171,6 +1174,7 @@ TEST_F(TopSitesTest, Blacklisting) { EXPECT_EQ(themes_url(), urls()[1].url); top_sites().RemoveBlacklistedURL(GURL("http://google.com/")); + EXPECT_TRUE(top_sites().HasBlacklistedItems()); { Lock& l = lock(); AutoLock lock(l); // IsBlacklisted must be in a lock. @@ -1187,6 +1191,7 @@ TEST_F(TopSitesTest, Blacklisting) { EXPECT_EQ(themes_url(), urls()[2].url); top_sites().ClearBlacklistedURLs(); + EXPECT_FALSE(top_sites().HasBlacklistedItems()); top_sites().GetMostVisitedURLs( &c, NewCallback(static_cast<TopSitesTest*>(this), |