| Index: chrome/browser/component_updater/cld_component_installer.cc
|
| diff --git a/chrome/browser/component_updater/cld_component_installer.cc b/chrome/browser/component_updater/cld_component_installer.cc
|
| index 3ec1f595e63dec2dfdbf71ac4ce59db7796bc49d..f2d50472125fc7357fab3971cba950f2362a0ab2 100644
|
| --- a/chrome/browser/component_updater/cld_component_installer.cc
|
| +++ b/chrome/browser/component_updater/cld_component_installer.cc
|
| @@ -12,11 +12,8 @@
|
| #include "base/files/file_path.h"
|
| #include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| -#include "base/path_service.h"
|
| #include "base/platform_file.h"
|
| -#include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/common/chrome_constants.h"
|
| -#include "chrome/common/chrome_paths.h"
|
| +#include "base/values.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "net/ssl/ssl_config_service.h"
|
|
|
| @@ -47,7 +44,10 @@ const uint8 kPublicKeySHA256[32] = {
|
|
|
| const char kCldManifestName[] = "CLD2 Data";
|
|
|
| -CldComponentInstallerTraits::CldComponentInstallerTraits() {
|
| +CldComponentInstallerTraits::CldComponentInstallerTraits(
|
| + const base::FilePath& base_dir, const base::FilePath& data_filename)
|
| + : base_dir_(base_dir),
|
| + data_filename_(data_filename) {
|
| }
|
|
|
| bool CldComponentInstallerTraits::CanAutoUpdate() const {
|
| @@ -61,13 +61,13 @@ bool CldComponentInstallerTraits::OnCustomInstall(
|
| }
|
|
|
| base::FilePath CldComponentInstallerTraits::GetInstalledPath(
|
| - const base::FilePath& base) {
|
| + const base::FilePath& base) const {
|
| // Currently, all platforms have the file at the same location because there
|
| // is no binary difference in the generated file on any supported platform.
|
| // NB: This may change when 64-bit is officially supported.
|
| return base.Append(FILE_PATH_LITERAL("_platform_specific"))
|
| .Append(FILE_PATH_LITERAL("all"))
|
| - .Append(chrome::kCLDDataFilename);
|
| + .Append(data_filename_);
|
| }
|
|
|
| void CldComponentInstallerTraits::ComponentReady(
|
| @@ -92,9 +92,7 @@ bool CldComponentInstallerTraits::VerifyInstallation(
|
| }
|
|
|
| base::FilePath CldComponentInstallerTraits::GetBaseDirectory() const {
|
| - base::FilePath result;
|
| - PathService::Get(chrome::DIR_COMPONENT_CLD2, &result);
|
| - return result;
|
| + return base_dir_;
|
| }
|
|
|
| void CldComponentInstallerTraits::GetHash(std::vector<uint8>* hash) const {
|
| @@ -106,9 +104,11 @@ std::string CldComponentInstallerTraits::GetName() const {
|
| return kCldManifestName;
|
| }
|
|
|
| -void RegisterCldComponent(ComponentUpdateService* cus) {
|
| +void RegisterCldComponent(ComponentUpdateService* cus,
|
| + const base::FilePath& base_dir,
|
| + const base::FilePath& data_filename) {
|
| scoped_ptr<ComponentInstallerTraits> traits(
|
| - new CldComponentInstallerTraits());
|
| + new CldComponentInstallerTraits(base_dir, data_filename));
|
| // |cus| will take ownership of |installer| during installer->Register(cus).
|
| DefaultComponentInstaller* installer =
|
| new DefaultComponentInstaller(traits.Pass());
|
|
|