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

Unified Diff: chrome/browser/component_updater/cld_component_installer.cc

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the harness factory methods private Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 a761ee6988175c3479f5dc2b5d5f4c5eff7bda11..0eb29d4188f62a250f19f288d09f7b063b0d7809 100644
--- a/chrome/browser/component_updater/cld_component_installer.cc
+++ b/chrome/browser/component_updater/cld_component_installer.cc
@@ -15,6 +15,7 @@
#include "base/path_service.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/translate/content/browser/browser_cld_data_provider.h"
+#include "components/translate/content/browser/browser_cld_data_provider_factory.h"
#include "components/translate/content/common/cld_data_source.h"
#include "content/public/browser/browser_thread.h"
#include "net/ssl/ssl_config_service.h"
@@ -106,13 +107,11 @@ std::string CldComponentInstallerTraits::GetName() const {
return kCldManifestName;
}
+// static
void RegisterCldComponent(ComponentUpdateService* cus) {
- // Make sure we don't start up if the CLD data source isn't compatible.
- if (!translate::CldDataSource::ShouldRegisterForComponentUpdates()) {
- // This is a serious build-time configuration error.
- LOG(ERROR) << "Wrong CLD data source: " <<
- translate::CldDataSource::GetName();
- NOTREACHED();
+ if (!translate::CldDataSource::IsUsingComponentDataSource()) {
+ // The configured CLD data source isn't the "Component" data source, so
+ // there is nothing to do.
return;
}
@@ -132,7 +131,7 @@ void CldComponentInstallerTraits::SetLatestCldDataFile(
const base::FilePath& path) {
VLOG(1) << "Setting CLD data file location: " << path.value();
g_latest_cld_data_file.Get() = path;
- translate::SetCldDataFilePath(path);
+ translate::CldDataSource::Get()->SetCldDataFilePath(path);
}
base::FilePath CldComponentInstallerTraits::GetLatestCldDataFile() {

Powered by Google App Engine
This is Rietveld 408576698