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

Unified Diff: chrome/browser/translate/standalone_cld_data_harness.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/translate/standalone_cld_data_harness.cc
diff --git a/chrome/browser/translate/standalone_cld_data_harness.cc b/chrome/browser/translate/standalone_cld_data_harness.cc
index 92f8d63deea48f5f333f399ea09487552d90b92d..018f4a1095855ed0472773bc7359954958b74803 100644
--- a/chrome/browser/translate/standalone_cld_data_harness.cc
+++ b/chrome/browser/translate/standalone_cld_data_harness.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "chrome/common/chrome_paths.h"
+#include "components/translate/content/common/cld_data_source.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -21,10 +22,6 @@ const base::FilePath::CharType kStandaloneDataFileName[] =
namespace test {
-StandaloneCldDataHarness::StandaloneCldDataHarness() {
- // Constructor does nothing in all cases. See Init() for initialization.
-}
-
StandaloneCldDataHarness::~StandaloneCldDataHarness() {
DVLOG(1) << "Tearing down CLD data harness";
DeleteStandaloneDataFile();
@@ -33,6 +30,8 @@ StandaloneCldDataHarness::~StandaloneCldDataHarness() {
void StandaloneCldDataHarness::Init() {
DVLOG(1) << "Initializing CLD data harness";
// Dynamic data mode is enabled and we are using a standalone file.
+ translate::CldDataSource::Set(
+ translate::CldDataSource::GetStandaloneDataSource());
ASSERT_NO_FATAL_FAILURE(CopyStandaloneDataFile());
}
@@ -74,9 +73,4 @@ void StandaloneCldDataHarness::CopyStandaloneDataFile() {
ASSERT_TRUE(base::PathExists(target_file));
}
-scoped_ptr<CldDataHarness> CreateCldDataHarness() {
- scoped_ptr<CldDataHarness> result(new StandaloneCldDataHarness());
- return result.Pass();
-}
-
} // namespace test
« no previous file with comments | « chrome/browser/translate/standalone_cld_data_harness.h ('k') | chrome/browser/translate/static_cld_data_harness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698