OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/history/top_sites.h" | 5 #include "chrome/browser/history/top_sites.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 } | 357 } |
358 | 358 |
359 bool TopSites::HasBlacklistedItems() const { | 359 bool TopSites::HasBlacklistedItems() const { |
360 return !blacklist_->empty(); | 360 return !blacklist_->empty(); |
361 } | 361 } |
362 | 362 |
363 void TopSites::AddBlacklistedURL(const GURL& url) { | 363 void TopSites::AddBlacklistedURL(const GURL& url) { |
364 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 364 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
365 | 365 |
366 RemovePinnedURL(url); | 366 RemovePinnedURL(url); |
367 Value* dummy = Value::CreateNullValue(); | 367 Value* dummy = base::NullValue(); |
368 { | 368 { |
369 DictionaryPrefUpdate update(profile_->GetPrefs(), | 369 DictionaryPrefUpdate update(profile_->GetPrefs(), |
370 prefs::kNTPMostVisitedURLsBlacklist); | 370 prefs::kNTPMostVisitedURLsBlacklist); |
371 DictionaryValue* blacklist = update.Get(); | 371 DictionaryValue* blacklist = update.Get(); |
372 blacklist->SetWithoutPathExpansion(GetURLHash(url), dummy); | 372 blacklist->SetWithoutPathExpansion(GetURLHash(url), dummy); |
373 } | 373 } |
374 | 374 |
375 ResetThreadSafeCache(); | 375 ResetThreadSafeCache(); |
376 NotifyTopSitesChanged(); | 376 NotifyTopSitesChanged(); |
377 } | 377 } |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 SetTopSites(pages); | 1006 SetTopSites(pages); |
1007 | 1007 |
1008 // Used only in testing. | 1008 // Used only in testing. |
1009 NotificationService::current()->Notify( | 1009 NotificationService::current()->Notify( |
1010 chrome::NOTIFICATION_TOP_SITES_UPDATED, | 1010 chrome::NOTIFICATION_TOP_SITES_UPDATED, |
1011 Source<TopSites>(this), | 1011 Source<TopSites>(this), |
1012 Details<CancelableRequestProvider::Handle>(&handle)); | 1012 Details<CancelableRequestProvider::Handle>(&handle)); |
1013 } | 1013 } |
1014 | 1014 |
1015 } // namespace history | 1015 } // namespace history |
OLD | NEW |