OLD | NEW |
1 // Copyright 2016 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 #include "chrome/browser/component_updater/origin_trials_component_installer.h" | 5 #include "chrome/browser/component_updater/origin_trials_component_installer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 std::vector<uint8_t>* hash) const { | 95 std::vector<uint8_t>* hash) const { |
96 if (!hash) | 96 if (!hash) |
97 return; | 97 return; |
98 hash->assign(kSha256Hash, kSha256Hash + arraysize(kSha256Hash)); | 98 hash->assign(kSha256Hash, kSha256Hash + arraysize(kSha256Hash)); |
99 } | 99 } |
100 | 100 |
101 std::string OriginTrialsComponentInstallerTraits::GetName() const { | 101 std::string OriginTrialsComponentInstallerTraits::GetName() const { |
102 return "Origin Trials"; | 102 return "Origin Trials"; |
103 } | 103 } |
104 | 104 |
105 std::string OriginTrialsComponentInstallerTraits::GetAp() const { | 105 update_client::InstallerAttributes |
106 return std::string(); | 106 OriginTrialsComponentInstallerTraits::GetInstallerAttributes() const { |
| 107 return update_client::InstallerAttributes(); |
107 } | 108 } |
108 | 109 |
109 void RegisterOriginTrialsComponent(ComponentUpdateService* cus, | 110 void RegisterOriginTrialsComponent(ComponentUpdateService* cus, |
110 const base::FilePath& user_data_dir) { | 111 const base::FilePath& user_data_dir) { |
111 std::unique_ptr<ComponentInstallerTraits> traits( | 112 std::unique_ptr<ComponentInstallerTraits> traits( |
112 new OriginTrialsComponentInstallerTraits()); | 113 new OriginTrialsComponentInstallerTraits()); |
113 // |cus| will take ownership of |installer| during installer->Register(cus). | 114 // |cus| will take ownership of |installer| during installer->Register(cus). |
114 DefaultComponentInstaller* installer = | 115 DefaultComponentInstaller* installer = |
115 new DefaultComponentInstaller(std::move(traits)); | 116 new DefaultComponentInstaller(std::move(traits)); |
116 installer->Register(cus, base::Closure()); | 117 installer->Register(cus, base::Closure()); |
117 } | 118 } |
118 | 119 |
119 } // namespace component_updater | 120 } // namespace component_updater |
OLD | NEW |