Chromium Code Reviews| 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 233773be4426e7b8a02ba1fc0eb4d54da6ee986f..9dec61c7510e924c0a3cb57a1497847c5d6b928c 100644 |
| --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h |
| +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.h |
| @@ -12,7 +12,9 @@ |
| #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 "components/history/core/browser/history_service_observer.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| @@ -34,7 +36,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: |
| // 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 +55,10 @@ class LastDownloadFinder : public content::NotificationObserver { |
| static scoped_ptr<LastDownloadFinder> Create( |
| const LastDownloadCallback& callback); |
| + // history::HistoryServiceObserver: |
| + void OnHistoryServiceLoaded(HistoryService* service) override; |
|
brettw
2014/11/14 21:13:07
Private or protected.
nshaik
2014/11/15 07:04:15
Done.
|
| + void HistoryServiceBeingDeleted(HistoryService* history_service) override; |
| + |
| protected: |
| // Protected constructor so that unit tests can create a fake finder. |
| LastDownloadFinder(); |
| @@ -109,6 +116,10 @@ class LastDownloadFinder : public content::NotificationObserver { |
| // A factory for asynchronous operations on profiles' HistoryService. |
| base::WeakPtrFactory<LastDownloadFinder> weak_ptr_factory_; |
| + // HistoryServiceObserver |
| + ScopedObserver<HistoryService, HistoryServiceObserver> |
| + history_service_observer_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(LastDownloadFinder); |
| }; |