| 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 <memory> |
| 7 #include <string> | 8 #include <string> |
| 8 #include <utility> | 9 #include <utility> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/bind.h" | 12 #include "base/bind.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 14 #include "base/logging.h" | 15 #include "base/logging.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 130 |
| 130 std::string EVWhitelistComponentInstallerTraits::GetName() const { | 131 std::string EVWhitelistComponentInstallerTraits::GetName() const { |
| 131 return kEVWhitelistManifestName; | 132 return kEVWhitelistManifestName; |
| 132 } | 133 } |
| 133 | 134 |
| 134 update_client::InstallerAttributes | 135 update_client::InstallerAttributes |
| 135 EVWhitelistComponentInstallerTraits::GetInstallerAttributes() const { | 136 EVWhitelistComponentInstallerTraits::GetInstallerAttributes() const { |
| 136 return update_client::InstallerAttributes(); | 137 return update_client::InstallerAttributes(); |
| 137 } | 138 } |
| 138 | 139 |
| 140 std::vector<std::string> EVWhitelistComponentInstallerTraits::GetMimeTypes() |
| 141 const { |
| 142 return std::vector<std::string>(); |
| 143 } |
| 144 |
| 139 void RegisterEVWhitelistComponent(ComponentUpdateService* cus, | 145 void RegisterEVWhitelistComponent(ComponentUpdateService* cus, |
| 140 const base::FilePath& user_data_dir) { | 146 const base::FilePath& user_data_dir) { |
| 141 VLOG(1) << "Registering EV whitelist component."; | 147 VLOG(1) << "Registering EV whitelist component."; |
| 142 | 148 |
| 143 std::unique_ptr<ComponentInstallerTraits> traits( | 149 std::unique_ptr<ComponentInstallerTraits> traits( |
| 144 new EVWhitelistComponentInstallerTraits()); | 150 new EVWhitelistComponentInstallerTraits()); |
| 145 // |cus| will take ownership of |installer| during installer->Register(cus). | 151 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 146 DefaultComponentInstaller* installer = | 152 DefaultComponentInstaller* installer = |
| 147 new DefaultComponentInstaller(std::move(traits)); | 153 new DefaultComponentInstaller(std::move(traits)); |
| 148 installer->Register(cus, base::Closure()); | 154 installer->Register(cus, base::Closure()); |
| 149 | 155 |
| 150 content::BrowserThread::PostAfterStartupTask( | 156 content::BrowserThread::PostAfterStartupTask( |
| 151 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 157 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
| 152 base::Bind(&DeleteWhitelistCopy, user_data_dir)); | 158 base::Bind(&DeleteWhitelistCopy, user_data_dir)); |
| 153 } | 159 } |
| 154 | 160 |
| 155 } // namespace component_updater | 161 } // namespace component_updater |
| OLD | NEW |