| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   58 bool STHSetComponentInstallerTraits:: |   58 bool STHSetComponentInstallerTraits:: | 
|   59     SupportsGroupPolicyEnabledComponentUpdates() const { |   59     SupportsGroupPolicyEnabledComponentUpdates() const { | 
|   60   return false; |   60   return false; | 
|   61 } |   61 } | 
|   62  |   62  | 
|   63 // Public data is delivered via this component, no need for encryption. |   63 // Public data is delivered via this component, no need for encryption. | 
|   64 bool STHSetComponentInstallerTraits::RequiresNetworkEncryption() const { |   64 bool STHSetComponentInstallerTraits::RequiresNetworkEncryption() const { | 
|   65   return false; |   65   return false; | 
|   66 } |   66 } | 
|   67  |   67  | 
|   68 update_client::CrxInstaller::Result |   68 bool STHSetComponentInstallerTraits::OnCustomInstall( | 
|   69 STHSetComponentInstallerTraits::OnCustomInstall( |  | 
|   70     const base::DictionaryValue& manifest, |   69     const base::DictionaryValue& manifest, | 
|   71     const base::FilePath& install_dir) { |   70     const base::FilePath& install_dir) { | 
|   72   return update_client::CrxInstaller::Result(0);  // Nothing custom here. |   71   return true;  // Nothing custom here. | 
|   73 } |   72 } | 
|   74  |   73  | 
|   75 void STHSetComponentInstallerTraits::ComponentReady( |   74 void STHSetComponentInstallerTraits::ComponentReady( | 
|   76     const base::Version& version, |   75     const base::Version& version, | 
|   77     const base::FilePath& install_dir, |   76     const base::FilePath& install_dir, | 
|   78     std::unique_ptr<base::DictionaryValue> manifest) { |   77     std::unique_ptr<base::DictionaryValue> manifest) { | 
|   79   const base::Closure load_sths_closure = base::Bind( |   78   const base::Closure load_sths_closure = base::Bind( | 
|   80       &STHSetComponentInstallerTraits::LoadSTHsFromDisk, |   79       &STHSetComponentInstallerTraits::LoadSTHsFromDisk, | 
|   81       weak_ptr_factory_.GetWeakPtr(), GetInstalledPath(install_dir), version); |   80       weak_ptr_factory_.GetWeakPtr(), GetInstalledPath(install_dir), version); | 
|   82  |   81  | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  202  |  201  | 
|  203   std::unique_ptr<ComponentInstallerTraits> traits( |  202   std::unique_ptr<ComponentInstallerTraits> traits( | 
|  204       new STHSetComponentInstallerTraits(distributor)); |  203       new STHSetComponentInstallerTraits(distributor)); | 
|  205   // |cus| will take ownership of |installer| during installer->Register(cus). |  204   // |cus| will take ownership of |installer| during installer->Register(cus). | 
|  206   DefaultComponentInstaller* installer = |  205   DefaultComponentInstaller* installer = | 
|  207       new DefaultComponentInstaller(std::move(traits)); |  206       new DefaultComponentInstaller(std::move(traits)); | 
|  208   installer->Register(cus, base::Closure()); |  207   installer->Register(cus, base::Closure()); | 
|  209 } |  208 } | 
|  210  |  209  | 
|  211 }  // namespace component_updater |  210 }  // namespace component_updater | 
| OLD | NEW |