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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Removes the profile pointed to by |it| from profiles_ and reports results | 84 // Removes the profile pointed to by |it| from profiles_ and reports results |
85 // if there are no more pending queries. | 85 // if there are no more pending queries. |
86 void RemoveProfileAndReportIfDone(std::vector<Profile*>::iterator it); | 86 void RemoveProfileAndReportIfDone(std::vector<Profile*>::iterator it); |
87 | 87 |
88 // Invokes the caller-supplied callback with the download found. | 88 // Invokes the caller-supplied callback with the download found. |
89 void ReportResults(); | 89 void ReportResults(); |
90 | 90 |
91 // content::NotificationObserver methods. | 91 // content::NotificationObserver methods. |
92 virtual void Observe(int type, | 92 virtual void Observe(int type, |
93 const content::NotificationSource& source, | 93 const content::NotificationSource& source, |
94 const content::NotificationDetails& details) OVERRIDE; | 94 const content::NotificationDetails& details) override; |
95 | 95 |
96 // Caller-supplied callback to be invoked when the most recent download is | 96 // Caller-supplied callback to be invoked when the most recent download is |
97 // found. | 97 // found. |
98 LastDownloadCallback callback_; | 98 LastDownloadCallback callback_; |
99 | 99 |
100 // The profiles for which a download query is pending. | 100 // The profiles for which a download query is pending. |
101 std::vector<Profile*> profiles_; | 101 std::vector<Profile*> profiles_; |
102 | 102 |
103 // Registrar for observing profile lifecycle notifications. | 103 // Registrar for observing profile lifecycle notifications. |
104 content::NotificationRegistrar notification_registrar_; | 104 content::NotificationRegistrar notification_registrar_; |
105 | 105 |
106 // The most recent download, updated progressively as query results arrive. | 106 // The most recent download, updated progressively as query results arrive. |
107 history::DownloadRow most_recent_row_; | 107 history::DownloadRow most_recent_row_; |
108 | 108 |
109 // A factory for asynchronous operations on profiles' HistoryService. | 109 // A factory for asynchronous operations on profiles' HistoryService. |
110 base::WeakPtrFactory<LastDownloadFinder> weak_ptr_factory_; | 110 base::WeakPtrFactory<LastDownloadFinder> weak_ptr_factory_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(LastDownloadFinder); | 112 DISALLOW_COPY_AND_ASSIGN(LastDownloadFinder); |
113 }; | 113 }; |
114 | 114 |
115 } // namespace safe_browsing | 115 } // namespace safe_browsing |
116 | 116 |
117 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_
H_ | 117 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_LAST_DOWNLOAD_FINDER_
H_ |
OLD | NEW |