Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1599)

Side by Side Diff: chrome/browser/component_updater/sw_reporter_installer_win.h

Issue 2278013002: Add support for the ExperimentalSwReporterEngine field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 bool IsExperimentalEngineEnabled() const;
grt (UTC plus 2) 2016/08/25 15:42:13 // Returns true if the experimental engine is supp
Joe Mason 2016/08/25 17:52:59 Done.
69
67 SwReporterRunner reporter_runner_; 70 SwReporterRunner reporter_runner_;
71 bool is_experimental_engine_supported_;
Sorin Jianu 2016/08/25 03:04:29 can this be const?
Joe Mason 2016/08/25 15:50:05 Done.
68 72
69 DISALLOW_COPY_AND_ASSIGN(SwReporterInstallerTraits); 73 DISALLOW_COPY_AND_ASSIGN(SwReporterInstallerTraits);
70 }; 74 };
71 75
72 // Call once during startup to make the component update service aware of the 76 // Call once during startup to make the component update service aware of the
73 // SwReporter. 77 // SwReporter.
74 void RegisterSwReporterComponent(ComponentUpdateService* cus); 78 void RegisterSwReporterComponent(ComponentUpdateService* cus);
75 79
76 // Register local state preferences related to the SwReporter. 80 // Register local state preferences related to the SwReporter.
77 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry); 81 void RegisterPrefsForSwReporter(PrefRegistrySimple* registry);
78 82
79 // Register profile preferences related to the SwReporter. 83 // Register profile preferences related to the SwReporter.
80 void RegisterProfilePrefsForSwReporter( 84 void RegisterProfilePrefsForSwReporter(
81 user_prefs::PrefRegistrySyncable* registry); 85 user_prefs::PrefRegistrySyncable* registry);
82 86
83 } // namespace component_updater 87 } // namespace component_updater
84 88
85 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_ 89 #endif // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698