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

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 compilation Created 6 years, 4 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
Index: chrome/browser/history/history_service.cc
diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc
index b5a971b0adc6a7535326920c7ab55f9e8acdc8bb..89eb8ce70dd4f39262e5e57eff32e2c83c79fb82 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 {
@@ -1229,3 +1237,17 @@ void HistoryService::NotifyVisitDBObserversOnAddVisit(
FOR_EACH_OBSERVER(history::VisitDatabaseObserver, visit_database_observers_,
OnAddVisit(info));
}
+
+scoped_ptr<base::CallbackList<
+ void(HistoryService*, 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(this, changed_favicons);
+}

Powered by Google App Engine
This is Rietveld 408576698