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

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

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_backend_unittest.cc ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history_service.h
diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h
index 1e7f68c60aef869d1fc8a7177d5bd2ed670b08e0..b428b71cb83450ab82d1864927d22bb6ef909832 100644
--- a/chrome/browser/history/history_service.h
+++ b/chrome/browser/history/history_service.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback.h"
+#include "base/callback_list.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
@@ -442,6 +443,16 @@ class HistoryService : public content::NotificationObserver,
void NotifyVisitDBObserversOnAddVisit(const history::BriefVisitInfo& info);
+ // This callback is invoked when favicon change for urls.
+ typedef base::Callback<void(const std::set<GURL>&)> OnFaviconChangedCallback;
+
+ // Add a callback to the list. The callback will remain registered until the
+ // returned Subscription is destroyed. This must occurs before HistoryService
+ // is destroyed.
+ scoped_ptr<base::CallbackList<void(const std::set<GURL>&)>::Subscription>
+ AddFaviconChangedCallback(const OnFaviconChangedCallback& callback)
+ WARN_UNUSED_RESULT;
+
// Testing -------------------------------------------------------------------
// Runs |flushed| after bouncing off the history thread.
@@ -734,6 +745,9 @@ class HistoryService : public content::NotificationObserver,
// specified priority. The task will have ownership taken.
void ScheduleTask(SchedulePriority priority, const base::Closure& task);
+ // Invokes all callback registered by AddFaviconChangedCallback.
+ void NotifyFaviconChanged(const std::set<GURL>& changed_favicons);
+
// ScheduleAndForget ---------------------------------------------------------
//
// Functions for scheduling operations on the history thread that do not need
@@ -864,6 +878,9 @@ class HistoryService : public content::NotificationObserver,
ObserverList<history::VisitDatabaseObserver> visit_database_observers_;
+ base::CallbackList<void(const std::set<GURL>&)>
+ favicon_changed_callback_list_;
+
history::DeleteDirectiveHandler delete_directive_handler_;
DISALLOW_COPY_AND_ASSIGN(HistoryService);
« no previous file with comments | « chrome/browser/history/history_backend_unittest.cc ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698