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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/last_download_finder.h

Issue 573553004: Eliminate NOTIFICATION_HISTORY_LOADED notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
index a792f983c1f204d8f11fe7fce6329542427a51ba..8bbda857245352e6f3954019aa4c947c16bcaf82 100644
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
@@ -13,6 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/history/download_row.h"
+#include "components/history/core/browser/history_service_observer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -34,7 +35,8 @@ class ClientIncidentReport_DownloadDetails;
// Finds the most recent executable downloaded by any on-the-record profile with
// history that participates in safe browsing.
-class LastDownloadFinder : public content::NotificationObserver {
+class LastDownloadFinder : public history::HistoryServiceObserver,
+ public content::NotificationObserver {
public:
// The type of a callback run by the finder upon completion. The argument is a
// protobuf containing details of the download that was found, or an empty
@@ -52,6 +54,9 @@ class LastDownloadFinder : public content::NotificationObserver {
static scoped_ptr<LastDownloadFinder> Create(
const LastDownloadCallback& callback);
+ // Is called when |service| is loaded.
sdefresne 2014/10/20 13:15:42 // history::HistoryServiceObserver:
+ virtual void HistoryServiceLoaded(HistoryService* service) OVERRIDE;
sdefresne 2014/10/20 13:15:42 OVERRIDE -> override
+
protected:
// Protected constructor so that unit tests can create a fake finder.
LastDownloadFinder();

Powered by Google App Engine
This is Rietveld 408576698