| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/scoped_observer.h" | 16 #include "base/scoped_observer.h" |
| 17 #include "chrome/browser/history/download_row.h" | |
| 18 #include "chrome/browser/safe_browsing/incident_reporting/download_metadata_mana
ger.h" | 17 #include "chrome/browser/safe_browsing/incident_reporting/download_metadata_mana
ger.h" |
| 18 #include "components/history/core/browser/download_row.h" |
| 19 #include "components/history/core/browser/history_service_observer.h" | 19 #include "components/history/core/browser/history_service_observer.h" |
| 20 #include "content/public/browser/notification_observer.h" | 20 #include "content/public/browser/notification_observer.h" |
| 21 #include "content/public/browser/notification_registrar.h" | 21 #include "content/public/browser/notification_registrar.h" |
| 22 | 22 |
| 23 class HistoryService; | 23 class HistoryService; |
| 24 class Profile; | 24 class Profile; |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 class NotificationDetails; | 27 class NotificationDetails; |
| 28 class NotificationSource; | 28 class NotificationSource; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace history { | |
| 32 struct DownloadRow; | |
| 33 } | |
| 34 | |
| 35 namespace safe_browsing { | 31 namespace safe_browsing { |
| 36 | 32 |
| 37 class ClientIncidentReport_DownloadDetails; | 33 class ClientIncidentReport_DownloadDetails; |
| 38 | 34 |
| 39 // Finds the most recent executable downloaded by any on-the-record profile with | 35 // Finds the most recent executable downloaded by any on-the-record profile with |
| 40 // history that participates in safe browsing. | 36 // history that participates in safe browsing. |
| 41 class LastDownloadFinder : public content::NotificationObserver, | 37 class LastDownloadFinder : public content::NotificationObserver, |
| 42 public history::HistoryServiceObserver { | 38 public history::HistoryServiceObserver { |
| 43 public: | 39 public: |
| 44 typedef base::Callback<void( | 40 typedef base::Callback<void( |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 141 |
| 146 // A factory for asynchronous operations on profiles' HistoryService. | 142 // A factory for asynchronous operations on profiles' HistoryService. |
| 147 base::WeakPtrFactory<LastDownloadFinder> weak_ptr_factory_; | 143 base::WeakPtrFactory<LastDownloadFinder> weak_ptr_factory_; |
| 148 | 144 |
| 149 DISALLOW_COPY_AND_ASSIGN(LastDownloadFinder); | 145 DISALLOW_COPY_AND_ASSIGN(LastDownloadFinder); |
| 150 }; | 146 }; |
| 151 | 147 |
| 152 } // namespace safe_browsing | 148 } // namespace safe_browsing |
| 153 | 149 |
| 154 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_
H_ | 150 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_
H_ |
| OLD | NEW |