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

Unified Diff: components/translate/core/browser/translate_download_manager.cc

Issue 2819813002: Translate: remove --disable-translate flag (Closed)
Patch Set: Merge branch 'master' into translate_remove_disable_flag Created 3 years, 8 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: components/translate/core/browser/translate_download_manager.cc
diff --git a/components/translate/core/browser/translate_download_manager.cc b/components/translate/core/browser/translate_download_manager.cc
index a431403e700b807ef07a27320d4b68ad958f74a8..88c01777409bc1943e92387aa82a75b895c43b2d 100644
--- a/components/translate/core/browser/translate_download_manager.cc
+++ b/components/translate/core/browser/translate_download_manager.cc
@@ -4,7 +4,6 @@
#include "components/translate/core/browser/translate_download_manager.h"
-#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "components/prefs/pref_service.h"
@@ -31,30 +30,21 @@ void TranslateDownloadManager::Shutdown() {
}
// static
-void TranslateDownloadManager::RequestLanguageList() {
+void TranslateDownloadManager::RequestLanguageList(PrefService* prefs) {
+ // We don't want to do this when translate is disabled.
+ DCHECK(prefs != NULL);
+ if (!prefs->GetBoolean(prefs::kEnableTranslate))
+ return;
+
TranslateLanguageList* language_list = GetInstance()->language_list();
if (!language_list) {
NOTREACHED();
return;
}
-
language_list->RequestLanguageList();
}
// static
-void TranslateDownloadManager::RequestLanguageList(PrefService* prefs) {
- // We don't want to do this when translate is disabled.
- DCHECK(prefs != NULL);
- if (base::CommandLine::ForCurrentProcess()->HasSwitch(
- translate::switches::kDisableTranslate) ||
- !prefs->GetBoolean(prefs::kEnableTranslate)) {
- return;
- }
-
- RequestLanguageList();
-}
-
-// static
void TranslateDownloadManager::GetSupportedLanguages(
std::vector<std::string>* languages) {
TranslateLanguageList* language_list = GetInstance()->language_list();
« no previous file with comments | « components/translate/core/browser/translate_download_manager.h ('k') | components/translate/core/browser/translate_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698