Chromium Code Reviews| 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 76900cbd7462f1cdd8cab03bc203d002da25e244..f94c32aef9f8e016f265872bed7a8f53ca074c17 100644 |
| --- a/chrome/browser/component_updater/cld_component_installer.cc |
| +++ b/chrome/browser/component_updater/cld_component_installer.cc |
| @@ -14,7 +14,7 @@ |
| #include "base/logging.h" |
| #include "base/path_service.h" |
| #include "components/component_updater/component_updater_paths.h" |
| -#include "components/translate/content/browser/data_file_browser_cld_data_provider.h" |
| +#include "components/translate/content/browser/browser_cld_data_provider.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "net/ssl/ssl_config_service.h" |
| @@ -25,7 +25,11 @@ namespace { |
| // If you change this, also update component_cld_data_harness.cc |
| // and cld_component_installer_unittest.cc accordingly! |
| const base::FilePath::CharType kCldDataFileName[] = |
| - FILE_PATH_LITERAL("cld2_data.bin"); |
| + FILE_PATH_LITERAL("cld2_data.bin"); |
| + |
| +// Tracks the last value seen in SetLatestCldDataFile, for testing purposes. |
| +base::LazyInstance<base::FilePath>::Leaky g_latest_cld_data_file_for_test = |
|
Sorin Jianu
2014/07/29 22:42:36
Is this still test code?
|
| + LAZY_INSTANCE_INITIALIZER; |
| } // namespace |
| namespace component_updater { |
| @@ -116,7 +120,12 @@ void RegisterCldComponent(ComponentUpdateService* cus) { |
| void CldComponentInstallerTraits::SetLatestCldDataFile( |
| const base::FilePath& path) { |
| VLOG(1) << "Setting CLD data file location: " << path.value(); |
| - translate::DataFileBrowserCldDataProvider::SetCldDataFilePath(path); |
| + *g_latest_cld_data_file_for_test.Pointer() = path; |
| + translate::SetCldDataFilePath(path); |
| +} |
| + |
| +base::FilePath CldComponentInstallerTraits::GetLatestCldDataFile() { |
| + return *g_latest_cld_data_file_for_test.Pointer(); |
| } |
| } // namespace component_updater |