| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Called during startup and installation before ComponentReady(). | 112 // Called during startup and installation before ComponentReady(). |
| 113 bool EVWhitelistComponentInstallerTraits::VerifyInstallation( | 113 bool EVWhitelistComponentInstallerTraits::VerifyInstallation( |
| 114 const base::DictionaryValue& manifest, | 114 const base::DictionaryValue& manifest, |
| 115 const base::FilePath& install_dir) const { | 115 const base::FilePath& install_dir) const { |
| 116 return base::PathExists(GetInstalledPath(install_dir)); | 116 return base::PathExists(GetInstalledPath(install_dir)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 base::FilePath EVWhitelistComponentInstallerTraits::GetBaseDirectory() const { | 119 std::string EVWhitelistComponentInstallerTraits::GetASCIIDirectoryName() const { |
| 120 base::FilePath result; | 120 return "EVWhitelist"; |
| 121 PathService::Get(DIR_COMPONENT_EV_WHITELIST, &result); | |
| 122 return result; | |
| 123 } | 121 } |
| 124 | 122 |
| 125 void EVWhitelistComponentInstallerTraits::GetHash( | 123 void EVWhitelistComponentInstallerTraits::GetHash( |
| 126 std::vector<uint8_t>* hash) const { | 124 std::vector<uint8_t>* hash) const { |
| 127 hash->assign(kPublicKeySHA256, | 125 hash->assign(kPublicKeySHA256, |
| 128 kPublicKeySHA256 + arraysize(kPublicKeySHA256)); | 126 kPublicKeySHA256 + arraysize(kPublicKeySHA256)); |
| 129 } | 127 } |
| 130 | 128 |
| 131 std::string EVWhitelistComponentInstallerTraits::GetName() const { | 129 std::string EVWhitelistComponentInstallerTraits::GetName() const { |
| 132 return kEVWhitelistManifestName; | 130 return kEVWhitelistManifestName; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 146 DefaultComponentInstaller* installer = | 144 DefaultComponentInstaller* installer = |
| 147 new DefaultComponentInstaller(std::move(traits)); | 145 new DefaultComponentInstaller(std::move(traits)); |
| 148 installer->Register(cus, base::Closure()); | 146 installer->Register(cus, base::Closure()); |
| 149 | 147 |
| 150 content::BrowserThread::PostAfterStartupTask( | 148 content::BrowserThread::PostAfterStartupTask( |
| 151 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 149 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
| 152 base::Bind(&DeleteWhitelistCopy, user_data_dir)); | 150 base::Bind(&DeleteWhitelistCopy, user_data_dir)); |
| 153 } | 151 } |
| 154 | 152 |
| 155 } // namespace component_updater | 153 } // namespace component_updater |
| OLD | NEW |