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

Unified Diff: chrome/browser/translate/chrome_translate_client.cc

Issue 2034413003: Delete the non-static CLD data source logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to latest master Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/translate/chrome_translate_client.cc
diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc
index c0fb526966ce33330d32d894537ee517151b8373..ca20515387c9ea501c4ae15b5355d13b76790f90 100644
--- a/chrome/browser/translate/chrome_translate_client.cc
+++ b/chrome/browser/translate/chrome_translate_client.cc
@@ -25,7 +25,6 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
-#include "components/translate/content/common/cld_data_source.h"
#include "components/translate/content/common/translate_messages.h"
#include "components/translate/core/browser/language_state.h"
#include "components/translate/core/browser/page_translated_details.h"
@@ -42,18 +41,6 @@
#include "grit/theme_resources.h"
#include "url/gurl.h"
-namespace {
-
-// TODO(andrewhayden): Make the data file path into a gyp/gn define
-// If you change this, also update standalone_cld_data_harness.cc
-// accordingly!
-const base::FilePath::CharType kCldDataFileName[] =
- FILE_PATH_LITERAL("cld2_data.bin");
-
-bool g_cld_file_path_initialized_ = false;
-
-} // namespace
-
DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeTranslateClient);
ChromeTranslateClient::ChromeTranslateClient(content::WebContents* web_contents)
@@ -63,24 +50,6 @@ ChromeTranslateClient::ChromeTranslateClient(content::WebContents* web_contents)
new translate::TranslateManager(this, prefs::kAcceptLanguages)) {
translate_driver_.AddObserver(this);
translate_driver_.set_translate_manager(translate_manager_.get());
- // Customization: for the standalone data source, we configure the path to
- // CLD data immediately on startup.
- // TODO(andrewhayden): This belongs in the data source implementation, not
- // here.
- if (translate::CldDataSource::IsUsingStandaloneDataSource() &&
- !g_cld_file_path_initialized_) {
- DVLOG(1) << "Initializing CLD file path for the first time.";
- base::FilePath path;
- if (!PathService::Get(chrome::DIR_USER_DATA, &path)) {
- // Chrome isn't properly installed
- LOG(WARNING) << "Unable to locate user data directory";
- } else {
- g_cld_file_path_initialized_ = true;
- path = path.Append(kCldDataFileName);
- DVLOG(1) << "Setting CLD data file path: " << path.value();
- translate::CldDataSource::Get()->SetCldDataFilePath(path);
- }
- }
}
ChromeTranslateClient::~ChromeTranslateClient() {
« no previous file with comments | « chrome/browser/resources/translate_internals/prefs.html ('k') | chrome/browser/translate/cld_data_harness.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698