OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DOWNLOAD_FEEDBACK_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_FEEDBACK_SERVICE_H_ |
6 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_FEEDBACK_SERVICE_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_FEEDBACK_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 namespace safe_browsing { | 29 namespace safe_browsing { |
30 | 30 |
31 class DownloadFeedback; | 31 class DownloadFeedback; |
32 | 32 |
33 // Tracks active DownloadFeedback objects, provides interface for storing ping | 33 // Tracks active DownloadFeedback objects, provides interface for storing ping |
34 // data for malicious downloads. | 34 // data for malicious downloads. |
35 class DownloadFeedbackService : public base::NonThreadSafe { | 35 class DownloadFeedbackService : public base::NonThreadSafe { |
36 public: | 36 public: |
| 37 // Possible values for prefs::kSafeBrowsingDownloadReportingEnabled pref. |
| 38 enum DownloadReportingStatus { |
| 39 kDialogNotYetShown, |
| 40 kDownloadReportingDisabled, |
| 41 kDownloadReportingEnabled, |
| 42 kMaxValue |
| 43 }; |
| 44 |
37 DownloadFeedbackService(net::URLRequestContextGetter* request_context_getter, | 45 DownloadFeedbackService(net::URLRequestContextGetter* request_context_getter, |
38 base::TaskRunner* file_task_runner); | 46 base::TaskRunner* file_task_runner); |
39 ~DownloadFeedbackService(); | 47 ~DownloadFeedbackService(); |
40 | 48 |
41 // Stores the request and response ping data from the download check, if the | 49 // Stores the request and response ping data from the download check, if the |
42 // check result and file size are eligible. This must be called after a | 50 // check result and file size are eligible. This must be called after a |
43 // download has been flagged as malicious in order for the download to be | 51 // download has been flagged as malicious in order for the download to be |
44 // enabled for uploading. | 52 // enabled for uploading. |
45 static void MaybeStorePingsForDownload( | 53 static void MaybeStorePingsForDownload( |
46 DownloadProtectionService::DownloadCheckResult result, | 54 DownloadProtectionService::DownloadCheckResult result, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // items are pending. | 95 // items are pending. |
88 ScopedVector<DownloadFeedback> active_feedback_; | 96 ScopedVector<DownloadFeedback> active_feedback_; |
89 | 97 |
90 base::WeakPtrFactory<DownloadFeedbackService> weak_ptr_factory_; | 98 base::WeakPtrFactory<DownloadFeedbackService> weak_ptr_factory_; |
91 | 99 |
92 DISALLOW_COPY_AND_ASSIGN(DownloadFeedbackService); | 100 DISALLOW_COPY_AND_ASSIGN(DownloadFeedbackService); |
93 }; | 101 }; |
94 } // namespace safe_browsing | 102 } // namespace safe_browsing |
95 | 103 |
96 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_FEEDBACK_SERVICE_H_ | 104 #endif // CHROME_BROWSER_SAFE_BROWSING_DOWNLOAD_FEEDBACK_SERVICE_H_ |
OLD | NEW |