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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/common/safe_browsing/csd.pb.h" | 26 #include "chrome/common/safe_browsing/csd.pb.h" |
27 #include "chrome/common/safe_browsing/download_protection_util.h" | 27 #include "chrome/common/safe_browsing/download_protection_util.h" |
28 #include "chrome/common/safe_browsing/file_type_policies.h" | 28 #include "chrome/common/safe_browsing/file_type_policies.h" |
29 #include "components/history/core/browser/download_constants.h" | 29 #include "components/history/core/browser/download_constants.h" |
30 #include "components/history/core/browser/history_service.h" | 30 #include "components/history/core/browser/history_service.h" |
31 #include "components/prefs/pref_service.h" | 31 #include "components/prefs/pref_service.h" |
32 #include "content/public/browser/notification_details.h" | 32 #include "content/public/browser/notification_details.h" |
33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
35 #include "crypto/sha2.h" | 35 #include "crypto/sha2.h" |
| 36 #include "extensions/features/features.h" |
36 | 37 |
37 namespace safe_browsing { | 38 namespace safe_browsing { |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 // The following functions are overloaded for the two object types that | 42 // The following functions are overloaded for the two object types that |
42 // represent the metadata for a download: history::DownloadRow and | 43 // represent the metadata for a download: history::DownloadRow and |
43 // ClientIncidentReport_DownloadDetails. These are used by the template | 44 // ClientIncidentReport_DownloadDetails. These are used by the template |
44 // functions that follow. | 45 // functions that follow. |
45 | 46 |
(...skipping 20 matching lines...) Expand all Loading... |
66 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
67 if (download_type == ClientDownloadRequest::MAC_EXECUTABLE || | 68 if (download_type == ClientDownloadRequest::MAC_EXECUTABLE || |
68 download_type == ClientDownloadRequest::INVALID_MAC_ARCHIVE) | 69 download_type == ClientDownloadRequest::INVALID_MAC_ARCHIVE) |
69 return true; | 70 return true; |
70 #elif defined(OS_ANDROID) | 71 #elif defined(OS_ANDROID) |
71 if (download_type == ClientDownloadRequest::ANDROID_APK) | 72 if (download_type == ClientDownloadRequest::ANDROID_APK) |
72 return true; | 73 return true; |
73 #endif | 74 #endif |
74 | 75 |
75 // Extensions are supported where enabled. | 76 // Extensions are supported where enabled. |
76 #if defined(ENABLE_EXTENSIONS) | 77 #if BUILDFLAG(ENABLE_EXTENSIONS) |
77 if (download_type == ClientDownloadRequest::CHROME_EXTENSION) | 78 if (download_type == ClientDownloadRequest::CHROME_EXTENSION) |
78 return true; | 79 return true; |
79 #endif | 80 #endif |
80 | 81 |
81 if (download_type == ClientDownloadRequest::ZIPPED_EXECUTABLE || | 82 if (download_type == ClientDownloadRequest::ZIPPED_EXECUTABLE || |
82 download_type == ClientDownloadRequest::ZIPPED_ARCHIVE || | 83 download_type == ClientDownloadRequest::ZIPPED_ARCHIVE || |
83 download_type == ClientDownloadRequest::INVALID_ZIP || | 84 download_type == ClientDownloadRequest::INVALID_ZIP || |
84 download_type == ClientDownloadRequest::ARCHIVE || | 85 download_type == ClientDownloadRequest::ARCHIVE || |
85 download_type == ClientDownloadRequest::PPAPI_SAVE_REQUEST) { | 86 download_type == ClientDownloadRequest::PPAPI_SAVE_REQUEST) { |
86 return true; | 87 return true; |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 } | 446 } |
446 } | 447 } |
447 } | 448 } |
448 | 449 |
449 void LastDownloadFinder::HistoryServiceBeingDeleted( | 450 void LastDownloadFinder::HistoryServiceBeingDeleted( |
450 history::HistoryService* history_service) { | 451 history::HistoryService* history_service) { |
451 history_service_observer_.Remove(history_service); | 452 history_service_observer_.Remove(history_service); |
452 } | 453 } |
453 | 454 |
454 } // namespace safe_browsing | 455 } // namespace safe_browsing |
OLD | NEW |