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 #include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
" | 5 #include "chrome/browser/safe_browsing/incident_reporting/last_download_finder.h
" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 // Returns the end time of a download represented by a DownloadDetails. | 41 // Returns the end time of a download represented by a DownloadDetails. |
42 int64 GetEndTime(const ClientIncidentReport_DownloadDetails& details) { | 42 int64 GetEndTime(const ClientIncidentReport_DownloadDetails& details) { |
43 return details.download_time_msec(); | 43 return details.download_time_msec(); |
44 } | 44 } |
45 | 45 |
46 // Returns true if a download represented by a DownloadRow is binary file. | 46 // Returns true if a download represented by a DownloadRow is binary file. |
47 bool IsBinaryDownload(const history::DownloadRow& row) { | 47 bool IsBinaryDownload(const history::DownloadRow& row) { |
48 // TODO(grt): Peek into archives to see if they contain binaries; | 48 // TODO(grt): Peek into archives to see if they contain binaries; |
49 // http://crbug.com/386915. | 49 // http://crbug.com/386915. |
50 return (download_protection_util::IsBinaryFile(row.target_path) && | 50 return (download_protection_util::IsSupportedBinaryFile(row.target_path) && |
51 !download_protection_util::IsArchiveFile(row.target_path)); | 51 !download_protection_util::IsArchiveFile(row.target_path)); |
52 } | 52 } |
53 | 53 |
54 // Returns true if a download represented by a DownloadDetails is binary file. | 54 // Returns true if a download represented by a DownloadDetails is binary file. |
55 bool IsBinaryDownload(const ClientIncidentReport_DownloadDetails& details) { | 55 bool IsBinaryDownload(const ClientIncidentReport_DownloadDetails& details) { |
56 // DownloadDetails are only generated for binary downloads. | 56 // DownloadDetails are only generated for binary downloads. |
57 return true; | 57 return true; |
58 } | 58 } |
59 | 59 |
60 // Returns true if a download represented by a DownloadRow has been opened. | 60 // Returns true if a download represented by a DownloadRow has been opened. |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 } | 340 } |
341 } | 341 } |
342 | 342 |
343 void LastDownloadFinder::HistoryServiceBeingDeleted( | 343 void LastDownloadFinder::HistoryServiceBeingDeleted( |
344 history::HistoryService* history_service) { | 344 history::HistoryService* history_service) { |
345 history_service_observer_.Remove(history_service); | 345 history_service_observer_.Remove(history_service); |
346 } | 346 } |
347 | 347 |
348 } // namespace safe_browsing | 348 } // namespace safe_browsing |
OLD | NEW |