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> |
(...skipping 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 class ComponentUpdateService; | 36 class ComponentUpdateService; |
37 | 37 |
38 // Callback for running the software reporter after it is downloaded. | 38 // Callback for running the software reporter after it is downloaded. |
39 using SwReporterRunner = | 39 using SwReporterRunner = |
40 base::Callback<void(const safe_browsing::SwReporterInvocation& invocation, | 40 base::Callback<void(const safe_browsing::SwReporterInvocation& invocation, |
41 const base::Version& version)>; | 41 const base::Version& version)>; |
42 | 42 |
43 class SwReporterInstallerTraits : public ComponentInstallerTraits { | 43 class SwReporterInstallerTraits : public ComponentInstallerTraits { |
44 public: | 44 public: |
45 explicit SwReporterInstallerTraits(const SwReporterRunner& reporter_runner); | 45 SwReporterInstallerTraits(const SwReporterRunner& reporter_runner, |
46 bool is_experimental_engine_supported); | |
46 ~SwReporterInstallerTraits() override; | 47 ~SwReporterInstallerTraits() override; |
47 | 48 |
48 private: | |
49 friend class SwReporterInstallerTest; | |
50 | |
51 // ComponentInstallerTraits implementation. | 49 // ComponentInstallerTraits implementation. |
52 bool VerifyInstallation(const base::DictionaryValue& manifest, | 50 bool VerifyInstallation(const base::DictionaryValue& manifest, |
53 const base::FilePath& dir) const override; | 51 const base::FilePath& dir) const override; |
54 bool SupportsGroupPolicyEnabledComponentUpdates() const override; | 52 bool SupportsGroupPolicyEnabledComponentUpdates() const override; |
55 bool RequiresNetworkEncryption() const override; | 53 bool RequiresNetworkEncryption() const override; |
56 bool OnCustomInstall(const base::DictionaryValue& manifest, | 54 bool OnCustomInstall(const base::DictionaryValue& manifest, |
57 const base::FilePath& install_dir) override; | 55 const base::FilePath& install_dir) override; |
58 void ComponentReady(const base::Version& version, | 56 void ComponentReady(const base::Version& version, |
59 const base::FilePath& install_dir, | 57 const base::FilePath& install_dir, |
60 std::unique_ptr<base::DictionaryValue> manifest) override; | 58 std::unique_ptr<base::DictionaryValue> manifest) override; |
61 base::FilePath GetRelativeInstallDir() const override; | 59 base::FilePath GetRelativeInstallDir() const override; |
62 void GetHash(std::vector<uint8_t>* hash) const override; | 60 void GetHash(std::vector<uint8_t>* hash) const override; |
63 std::string GetName() const override; | 61 std::string GetName() const override; |
64 update_client::InstallerAttributes GetInstallerAttributes() const override; | 62 update_client::InstallerAttributes GetInstallerAttributes() const override; |
65 std::vector<std::string> GetMimeTypes() const override; | 63 std::vector<std::string> GetMimeTypes() const override; |
66 | 64 |
65 private: | |
66 friend class SwReporterInstallerTest; | |
67 | |
68 // Returns true if the experimental engine is supported and the Feature is | |
Sorin Jianu
2016/08/25 18:15:39
capital F intentional?
Joe Mason
2016/08/25 18:18:38
Yes, it's a class name.
| |
69 // enabled. | |
70 bool IsExperimentalEngineEnabled() const; | |
71 | |
67 SwReporterRunner reporter_runner_; | 72 SwReporterRunner reporter_runner_; |
73 const bool is_experimental_engine_supported_; | |
68 | 74 |
69 DISALLOW_COPY_AND_ASSIGN(SwReporterInstallerTraits); | 75 DISALLOW_COPY_AND_ASSIGN(SwReporterInstallerTraits); |
70 }; | 76 }; |
71 | 77 |
72 // Call once during startup to make the component update service aware of the | 78 // Call once during startup to make the component update service aware of the |
73 // SwReporter. | 79 // SwReporter. |
74 void RegisterSwReporterComponent(ComponentUpdateService* cus); | 80 void RegisterSwReporterComponent(ComponentUpdateService* cus); |
75 | 81 |
76 // Register local state preferences related to the SwReporter. | 82 // Register local state preferences related to the SwReporter. |
77 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry); | 83 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry); |
78 | 84 |
79 // Register profile preferences related to the SwReporter. | 85 // Register profile preferences related to the SwReporter. |
80 void RegisterProfilePrefsForSwReporter( | 86 void RegisterProfilePrefsForSwReporter( |
81 user_prefs::PrefRegistrySyncable* registry); | 87 user_prefs::PrefRegistrySyncable* registry); |
82 | 88 |
83 } // namespace component_updater | 89 } // namespace component_updater |
84 | 90 |
85 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ | 91 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ |
OLD | NEW |