OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "chrome/browser/safe_browsing/srt_fetcher_win.h" |
15 #include "components/component_updater/default_component_installer.h" | 16 #include "components/component_updater/default_component_installer.h" |
16 | 17 |
17 class PrefRegistrySimple; | 18 class PrefRegistrySimple; |
18 class PrefService; | 19 class PrefService; |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class DictionaryValue; | 22 class DictionaryValue; |
22 class FilePath; | 23 class FilePath; |
23 class Version; | 24 class Version; |
24 } | 25 } |
25 | 26 |
26 namespace safe_browsing { | |
27 struct SwReporterInvocation; | |
28 } | |
29 | |
30 namespace user_prefs { | 27 namespace user_prefs { |
31 class PrefRegistrySyncable; | 28 class PrefRegistrySyncable; |
32 } | 29 } |
33 | 30 |
34 namespace component_updater { | 31 namespace component_updater { |
35 | 32 |
36 class ComponentUpdateService; | 33 class ComponentUpdateService; |
37 | 34 |
38 // These MUST match the values for SwReporterExperimentError in histograms.xml. | 35 // These MUST match the values for SwReporterExperimentError in histograms.xml. |
39 // Exposed for testing. | 36 // Exposed for testing. |
40 enum SwReporterExperimentError { | 37 enum SwReporterExperimentError { |
41 SW_REPORTER_EXPERIMENT_ERROR_BAD_TAG = 0, | 38 SW_REPORTER_EXPERIMENT_ERROR_BAD_TAG = 0, |
42 SW_REPORTER_EXPERIMENT_ERROR_BAD_PARAMS = 1, | 39 SW_REPORTER_EXPERIMENT_ERROR_BAD_PARAMS = 1, |
43 SW_REPORTER_EXPERIMENT_ERROR_MAX, | 40 SW_REPORTER_EXPERIMENT_ERROR_MAX, |
44 }; | 41 }; |
45 | 42 |
46 // Callback for running the software reporter after it is downloaded. | 43 // Callback for running the software reporter after it is downloaded. |
47 using SwReporterRunner = | 44 using SwReporterRunner = |
48 base::Callback<void(const safe_browsing::SwReporterInvocation& invocation, | 45 base::Callback<void(const safe_browsing::SwReporterQueue& invocations, |
49 const base::Version& version)>; | 46 const base::Version& version)>; |
50 | 47 |
51 class SwReporterInstallerTraits : public ComponentInstallerTraits { | 48 class SwReporterInstallerTraits : public ComponentInstallerTraits { |
52 public: | 49 public: |
53 SwReporterInstallerTraits(const SwReporterRunner& reporter_runner, | 50 SwReporterInstallerTraits(const SwReporterRunner& reporter_runner, |
54 bool is_experimental_engine_supported); | 51 bool is_experimental_engine_supported); |
55 ~SwReporterInstallerTraits() override; | 52 ~SwReporterInstallerTraits() override; |
56 | 53 |
57 // ComponentInstallerTraits implementation. | 54 // ComponentInstallerTraits implementation. |
58 bool VerifyInstallation(const base::DictionaryValue& manifest, | 55 bool VerifyInstallation(const base::DictionaryValue& manifest, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Register local state preferences related to the SwReporter. | 87 // Register local state preferences related to the SwReporter. |
91 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry); | 88 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry); |
92 | 89 |
93 // Register profile preferences related to the SwReporter. | 90 // Register profile preferences related to the SwReporter. |
94 void RegisterProfilePrefsForSwReporter( | 91 void RegisterProfilePrefsForSwReporter( |
95 user_prefs::PrefRegistrySyncable* registry); | 92 user_prefs::PrefRegistrySyncable* registry); |
96 | 93 |
97 } // namespace component_updater | 94 } // namespace component_updater |
98 | 95 |
99 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ | 96 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ |
OLD | NEW |