| 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/sth_set_component_installer.h" | 5 #include "chrome/browser/component_updater/sth_set_component_installer.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_enumerator.h" | 10 #include "base/files/file_enumerator.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 std::string STHSetComponentInstallerTraits::GetName() const { | 111 std::string STHSetComponentInstallerTraits::GetName() const { |
| 112 return kSTHSetFetcherManifestName; | 112 return kSTHSetFetcherManifestName; |
| 113 } | 113 } |
| 114 | 114 |
| 115 update_client::InstallerAttributes | 115 update_client::InstallerAttributes |
| 116 STHSetComponentInstallerTraits::GetInstallerAttributes() const { | 116 STHSetComponentInstallerTraits::GetInstallerAttributes() const { |
| 117 return update_client::InstallerAttributes(); | 117 return update_client::InstallerAttributes(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 std::vector<std::string> STHSetComponentInstallerTraits::GetMimeTypes() const { |
| 121 return std::vector<std::string>(); |
| 122 } |
| 123 |
| 120 void STHSetComponentInstallerTraits::LoadSTHsFromDisk( | 124 void STHSetComponentInstallerTraits::LoadSTHsFromDisk( |
| 121 const base::FilePath& sths_path, | 125 const base::FilePath& sths_path, |
| 122 const base::Version& version) { | 126 const base::Version& version) { |
| 123 if (sths_path.empty()) | 127 if (sths_path.empty()) |
| 124 return; | 128 return; |
| 125 | 129 |
| 126 base::FileEnumerator sth_file_enumerator(sths_path, false, | 130 base::FileEnumerator sth_file_enumerator(sths_path, false, |
| 127 base::FileEnumerator::FILES, | 131 base::FileEnumerator::FILES, |
| 128 FILE_PATH_LITERAL("*.sth")); | 132 FILE_PATH_LITERAL("*.sth")); |
| 129 base::FilePath sth_file_path; | 133 base::FilePath sth_file_path; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 221 |
| 218 std::unique_ptr<ComponentInstallerTraits> traits( | 222 std::unique_ptr<ComponentInstallerTraits> traits( |
| 219 new STHSetComponentInstallerTraits(distributor)); | 223 new STHSetComponentInstallerTraits(distributor)); |
| 220 // |cus| will take ownership of |installer| during installer->Register(cus). | 224 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 221 DefaultComponentInstaller* installer = | 225 DefaultComponentInstaller* installer = |
| 222 new DefaultComponentInstaller(std::move(traits)); | 226 new DefaultComponentInstaller(std::move(traits)); |
| 223 installer->Register(cus, base::Closure()); | 227 installer->Register(cus, base::Closure()); |
| 224 } | 228 } |
| 225 | 229 |
| 226 } // namespace component_updater | 230 } // namespace component_updater |
| OLD | NEW |