| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" | 5 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 void EVWhitelistComponentInstallerTraits::GetHash( | 125 void EVWhitelistComponentInstallerTraits::GetHash( |
| 126 std::vector<uint8_t>* hash) const { | 126 std::vector<uint8_t>* hash) const { |
| 127 hash->assign(kPublicKeySHA256, | 127 hash->assign(kPublicKeySHA256, |
| 128 kPublicKeySHA256 + arraysize(kPublicKeySHA256)); | 128 kPublicKeySHA256 + arraysize(kPublicKeySHA256)); |
| 129 } | 129 } |
| 130 | 130 |
| 131 std::string EVWhitelistComponentInstallerTraits::GetName() const { | 131 std::string EVWhitelistComponentInstallerTraits::GetName() const { |
| 132 return kEVWhitelistManifestName; | 132 return kEVWhitelistManifestName; |
| 133 } | 133 } |
| 134 | 134 |
| 135 std::string EVWhitelistComponentInstallerTraits::GetAp() const { |
| 136 return std::string(); |
| 137 } |
| 138 |
| 135 void RegisterEVWhitelistComponent(ComponentUpdateService* cus, | 139 void RegisterEVWhitelistComponent(ComponentUpdateService* cus, |
| 136 const base::FilePath& user_data_dir) { | 140 const base::FilePath& user_data_dir) { |
| 137 VLOG(1) << "Registering EV whitelist component."; | 141 VLOG(1) << "Registering EV whitelist component."; |
| 138 | 142 |
| 139 scoped_ptr<ComponentInstallerTraits> traits( | 143 scoped_ptr<ComponentInstallerTraits> traits( |
| 140 new EVWhitelistComponentInstallerTraits()); | 144 new EVWhitelistComponentInstallerTraits()); |
| 141 // |cus| will take ownership of |installer| during installer->Register(cus). | 145 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 142 DefaultComponentInstaller* installer = | 146 DefaultComponentInstaller* installer = |
| 143 new DefaultComponentInstaller(std::move(traits)); | 147 new DefaultComponentInstaller(std::move(traits)); |
| 144 installer->Register(cus, base::Closure()); | 148 installer->Register(cus, base::Closure()); |
| 145 | 149 |
| 146 content::BrowserThread::PostAfterStartupTask( | 150 content::BrowserThread::PostAfterStartupTask( |
| 147 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 151 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
| 148 base::Bind(&DeleteWhitelistCopy, user_data_dir)); | 152 base::Bind(&DeleteWhitelistCopy, user_data_dir)); |
| 149 } | 153 } |
| 150 | 154 |
| 151 } // namespace component_updater | 155 } // namespace component_updater |
| OLD | NEW |