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

Unified Diff: chrome/browser/history/history_service.cc

Issue 484213002: Refactor HistoryService to not send NOTIFICATION_FAVICON_CHANGED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android unit tests Created 6 years, 3 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/history/history_service.h ('k') | chrome/browser/history/history_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_service.cc
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
index cb27fa7135756d3809224e42c6c817f9e4daaae1..0ab7a9f10e67119c1fb5c309d2c31c74e6c5868e 100644
--- a/chrome/browser/history/history_service.cc
+++ b/chrome/browser/history/history_service.cc
@@ -158,6 +158,14 @@ class HistoryService::BackendDelegate : public HistoryBackend::Delegate {
base::Passed(&backend)));
}
+ virtual void NotifyFaviconChanged(const std::set<GURL>& urls) OVERRIDE {
+ // Send the notification to the history service on the main thread.
+ service_task_runner_->PostTask(
+ FROM_HERE,
+ base::Bind(
+ &HistoryService::NotifyFaviconChanged, history_service_, urls));
+ }
+
virtual void BroadcastNotifications(
int type,
scoped_ptr<history::HistoryDetails> details) OVERRIDE {
@@ -1231,3 +1239,16 @@ void HistoryService::NotifyVisitDBObserversOnAddVisit(
FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
OnAddVisit(info));
}
+
+scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
+HistoryService::AddFaviconChangedCallback(
+ const HistoryService::OnFaviconChangedCallback& callback) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return favicon_changed_callback_list_.Add(callback);
+}
+
+void HistoryService::NotifyFaviconChanged(
+ const std::set<GURL>& changed_favicons) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ favicon_changed_callback_list_.Notify(changed_favicons);
+}
« no previous file with comments | « chrome/browser/history/history_service.h ('k') | chrome/browser/history/history_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698