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

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

Issue 25531002: Move language detection to a component (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Run translate unittests on iOS Created 7 years, 2 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
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.cc ('k') | chrome/browser/translate/translate_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_manager.cc
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index c3f7829e85e0f12515cb6f08da7f335677247229..2751f170e25ebf4844ebcb44aa62996b093167a7 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -33,12 +33,12 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/translate/language_detection_details.h"
#include "chrome/common/url_constants.h"
+#include "components/translate/common/translate_constants.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
@@ -466,7 +466,7 @@ void TranslateManager::TranslatePage(WebContents* web_contents,
// server side auto language detection.
std::string source_lang(original_source_lang);
if (!IsSupportedLanguage(source_lang))
- source_lang = std::string(chrome::kUnknownLanguageCode);
+ source_lang = std::string(translate::kUnknownLanguageCode);
Profile* profile =
Profile::FromBrowserContext(web_contents->GetBrowserContext());
@@ -580,7 +580,7 @@ void TranslateManager::DoTranslatePage(WebContents* web_contents,
void TranslateManager::PageTranslated(WebContents* web_contents,
PageTranslatedDetails* details) {
if ((details->error_type == TranslateErrors::NONE) &&
- details->source_language != chrome::kUnknownLanguageCode &&
+ details->source_language != translate::kUnknownLanguageCode &&
!IsSupportedLanguage(details->source_language)) {
details->error_type = TranslateErrors::UNSUPPORTED_LANGUAGE;
}
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.cc ('k') | chrome/browser/translate/translate_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698