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 62db1e476b5f3f057eed7254efe50d1fb145f218..7202547b7e9f24eca0f8ef6e2e8225d3a0da8c9b 100644 |
--- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h |
+++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h |
@@ -13,8 +13,10 @@ |
#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/memory/weak_ptr.h" |
+#include "base/scoped_observer.h" |
#include "chrome/browser/history/download_row.h" |
#include "chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.h" |
+#include "components/history/core/browser/history_service_observer.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
@@ -36,7 +38,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 content::NotificationObserver, |
+ public history::HistoryServiceObserver { |
public: |
typedef base::Callback<void( |
content::BrowserContext* context, |
@@ -116,6 +119,10 @@ class LastDownloadFinder : public content::NotificationObserver { |
const content::NotificationSource& source, |
const content::NotificationDetails& details) override; |
+ // history::HistoryServiceObserver: |
+ void OnHistoryServiceLoaded(HistoryService* service) override; |
+ void HistoryServiceBeingDeleted(HistoryService* history_service) override; |
+ |
// Caller-supplied callback to make an asynchronous request for a profile's |
// persistent download details. |
DownloadDetailsGetter download_details_getter_; |
@@ -137,6 +144,10 @@ class LastDownloadFinder : public content::NotificationObserver { |
// The most recent download, updated progressively as query results arrive. |
history::DownloadRow most_recent_row_; |
+ // HistoryServiceObserver |
+ ScopedObserver<HistoryService, HistoryServiceObserver> |
+ history_service_observer_; |
+ |
// A factory for asynchronous operations on profiles' HistoryService. |
base::WeakPtrFactory<LastDownloadFinder> weak_ptr_factory_; |