| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 0xe1, 0x96, 0x9f, 0x7c, 0xb1, 0x73, 0xef, 0x16, 0x80, 0x0a}; | 48 0xe1, 0x96, 0x9f, 0x7c, 0xb1, 0x73, 0xef, 0x16, 0x80, 0x0a}; |
| 49 | 49 |
| 50 const char kSTHSetFetcherManifestName[] = "Signed Tree Heads"; | 50 const char kSTHSetFetcherManifestName[] = "Signed Tree Heads"; |
| 51 | 51 |
| 52 STHSetComponentInstallerTraits::STHSetComponentInstallerTraits( | 52 STHSetComponentInstallerTraits::STHSetComponentInstallerTraits( |
| 53 net::ct::STHObserver* sth_observer) | 53 net::ct::STHObserver* sth_observer) |
| 54 : sth_observer_(sth_observer), weak_ptr_factory_(this) {} | 54 : sth_observer_(sth_observer), weak_ptr_factory_(this) {} |
| 55 | 55 |
| 56 STHSetComponentInstallerTraits::~STHSetComponentInstallerTraits() {} | 56 STHSetComponentInstallerTraits::~STHSetComponentInstallerTraits() {} |
| 57 | 57 |
| 58 bool STHSetComponentInstallerTraits::CanAutoUpdate() const { | 58 bool STHSetComponentInstallerTraits:: |
| 59 return true; | 59 SupportsGroupPolicyEnabledComponentUpdates() const { |
| 60 return false; |
| 60 } | 61 } |
| 61 | 62 |
| 62 // Public data is delivered via this component, no need for encryption. | 63 // Public data is delivered via this component, no need for encryption. |
| 63 bool STHSetComponentInstallerTraits::RequiresNetworkEncryption() const { | 64 bool STHSetComponentInstallerTraits::RequiresNetworkEncryption() const { |
| 64 return false; | 65 return false; |
| 65 } | 66 } |
| 66 | 67 |
| 67 bool STHSetComponentInstallerTraits::OnCustomInstall( | 68 bool STHSetComponentInstallerTraits::OnCustomInstall( |
| 68 const base::DictionaryValue& manifest, | 69 const base::DictionaryValue& manifest, |
| 69 const base::FilePath& install_dir) { | 70 const base::FilePath& install_dir) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 201 |
| 201 std::unique_ptr<ComponentInstallerTraits> traits( | 202 std::unique_ptr<ComponentInstallerTraits> traits( |
| 202 new STHSetComponentInstallerTraits(distributor)); | 203 new STHSetComponentInstallerTraits(distributor)); |
| 203 // |cus| will take ownership of |installer| during installer->Register(cus). | 204 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 204 DefaultComponentInstaller* installer = | 205 DefaultComponentInstaller* installer = |
| 205 new DefaultComponentInstaller(std::move(traits)); | 206 new DefaultComponentInstaller(std::move(traits)); |
| 206 installer->Register(cus, base::Closure()); | 207 installer->Register(cus, base::Closure()); |
| 207 } | 208 } |
| 208 | 209 |
| 209 } // namespace component_updater | 210 } // namespace component_updater |
| OLD | NEW |