Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: chrome/browser/component_updater/cld_component_installer.cc

Issue 397623002: Expose the CLD data source in chrome://translate-internals (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/common.gypi ('k') | chrome/browser/resources/translate_internals/prefs.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | chrome/browser/resources/translate_internals/prefs.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698