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/cld_component_installer.h" | 5 #include "chrome/browser/component_updater/cld_component_installer.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 void CldComponentInstallerTraits::GetHash(std::vector<uint8>* hash) const { | 96 void CldComponentInstallerTraits::GetHash(std::vector<uint8>* hash) const { |
97 hash->assign(kPublicKeySHA256, | 97 hash->assign(kPublicKeySHA256, |
98 kPublicKeySHA256 + arraysize(kPublicKeySHA256)); | 98 kPublicKeySHA256 + arraysize(kPublicKeySHA256)); |
99 } | 99 } |
100 | 100 |
101 std::string CldComponentInstallerTraits::GetName() const { | 101 std::string CldComponentInstallerTraits::GetName() const { |
102 return kCldManifestName; | 102 return kCldManifestName; |
103 } | 103 } |
104 | 104 |
105 void RegisterCldComponent(ComponentUpdateService* cus) { | 105 void RegisterCldComponent(ComponentUpdateService* cus) { |
| 106 // This log line is to help with determining which kind of provider has been |
| 107 // configured. See also: chrome://translate-internals |
| 108 VLOG(1) << "Registering CLD component with the component update service"; |
| 109 |
106 scoped_ptr<ComponentInstallerTraits> traits( | 110 scoped_ptr<ComponentInstallerTraits> traits( |
107 new CldComponentInstallerTraits()); | 111 new CldComponentInstallerTraits()); |
108 // |cus| will take ownership of |installer| during installer->Register(cus). | 112 // |cus| will take ownership of |installer| during installer->Register(cus). |
109 DefaultComponentInstaller* installer = | 113 DefaultComponentInstaller* installer = |
110 new DefaultComponentInstaller(traits.Pass()); | 114 new DefaultComponentInstaller(traits.Pass()); |
111 installer->Register(cus); | 115 installer->Register(cus); |
112 } | 116 } |
113 | 117 |
114 void CldComponentInstallerTraits::SetLatestCldDataFile( | 118 void CldComponentInstallerTraits::SetLatestCldDataFile( |
115 const base::FilePath& path) { | 119 const base::FilePath& path) { |
116 VLOG(1) << "Setting CLD data file location: " << path.value(); | 120 VLOG(1) << "Setting CLD data file location: " << path.value(); |
117 translate::DataFileBrowserCldDataProvider::SetCldDataFilePath(path); | 121 translate::DataFileBrowserCldDataProvider::SetCldDataFilePath(path); |
118 } | 122 } |
119 | 123 |
120 } // namespace component_updater | 124 } // namespace component_updater |
OLD | NEW |