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

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

Issue 1887743003: Allow the component updater framework to control Origin Trials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ef-finch
Patch Set: Rebase and fix missed scoped_ptr -> unique_ptr conversion Created 4 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_EV_WHITELIST_COMPONENT_INSTALLER_H_ 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_ORIGIN_TRIALS_COMPONENT_INSTALLER_H_
6 #define CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_ 6 #define CHROME_BROWSER_COMPONENT_UPDATER_ORIGIN_TRIALS_COMPONENT_INSTALLER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9
10 #include <memory>
9 #include <string> 11 #include <string>
10 #include <vector> 12 #include <vector>
11 13
12 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
13 #include "base/macros.h" 15 #include "base/macros.h"
14 #include "base/values.h" 16 #include "base/values.h"
17 #include "base/version.h"
15 #include "components/component_updater/default_component_installer.h" 18 #include "components/component_updater/default_component_installer.h"
16 19
17 namespace base {
18 class FilePath;
19 } // namespace base
20
21 namespace component_updater { 20 namespace component_updater {
22 21
23 class ComponentUpdateService; 22 class ComponentUpdateService;
24 23
25 class EVWhitelistComponentInstallerTraits : public ComponentInstallerTraits { 24 class OriginTrialsComponentInstallerTraits : public ComponentInstallerTraits {
26 public: 25 public:
27 EVWhitelistComponentInstallerTraits() {} 26 OriginTrialsComponentInstallerTraits() = default;
28 ~EVWhitelistComponentInstallerTraits() override {} 27 ~OriginTrialsComponentInstallerTraits() override = default;
29 28
30 private: 29 private:
31 // The following methods override ComponentInstallerTraits. 30 bool VerifyInstallation(const base::DictionaryValue& manifest,
31 const base::FilePath& install_dir) const override;
32 bool CanAutoUpdate() const override; 32 bool CanAutoUpdate() const override;
33 bool RequiresNetworkEncryption() const override; 33 bool RequiresNetworkEncryption() const override;
34 bool OnCustomInstall(const base::DictionaryValue& manifest, 34 bool OnCustomInstall(const base::DictionaryValue& manifest,
35 const base::FilePath& install_dir) override; 35 const base::FilePath& install_dir) override;
36 bool VerifyInstallation(const base::DictionaryValue& manifest,
37 const base::FilePath& install_dir) const override;
38 void ComponentReady(const base::Version& version, 36 void ComponentReady(const base::Version& version,
39 const base::FilePath& install_dir, 37 const base::FilePath& install_dir,
40 std::unique_ptr<base::DictionaryValue> manifest) override; 38 std::unique_ptr<base::DictionaryValue> manifest) override;
41 base::FilePath GetBaseDirectory() const override; 39 base::FilePath GetBaseDirectory() const override;
42 void GetHash(std::vector<uint8_t>* hash) const override; 40 void GetHash(std::vector<uint8_t>* hash) const override;
43 std::string GetName() const override; 41 std::string GetName() const override;
44 std::string GetAp() const override; 42 std::string GetAp() const override;
45 43
46 static base::FilePath GetInstalledPath(const base::FilePath& base); 44 DISALLOW_COPY_AND_ASSIGN(OriginTrialsComponentInstallerTraits);
47
48 DISALLOW_COPY_AND_ASSIGN(EVWhitelistComponentInstallerTraits);
49 }; 45 };
50 46
51 // Call once during startup to make the component update service aware of 47 // Call once during startup to make the component update service aware of
52 // the EV whitelist. 48 // the origin trials update component.
53 void RegisterEVWhitelistComponent(ComponentUpdateService* cus, 49 void RegisterOriginTrialsComponent(ComponentUpdateService* cus,
54 const base::FilePath& user_data_dir); 50 const base::FilePath& user_data_dir);
55 51
56 } // namespace component_updater 52 } // namespace component_updater
57 53
58 #endif // CHROME_BROWSER_COMPONENT_UPDATER_EV_WHITELIST_COMPONENT_INSTALLER_H_ 54 #endif // CHROME_BROWSER_COMPONENT_UPDATER_ORIGIN_TRIALS_COMPONENT_INSTALLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/component_updater/origin_trials_component_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698