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

Unified Diff: chrome/renderer/translate/translate_helper.cc

Issue 378253002: Fix translate namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/renderer/translate/translate_helper.cc
diff --git a/chrome/renderer/translate/translate_helper.cc b/chrome/renderer/translate/translate_helper.cc
index cffcfc55d92e040870ff44f43a00362d74e1cde9..2275f5b01e422b09e53fab5611b71d789c65117e 100644
--- a/chrome/renderer/translate/translate_helper.cc
+++ b/chrome/renderer/translate/translate_helper.cc
@@ -170,7 +170,7 @@ void TranslateHelper::PageCapturedImpl(int page_seq_no,
language_determined_time_ = base::TimeTicks::Now();
GURL url(document.url());
- LanguageDetectionDetails details;
+ translate::LanguageDetectionDetails details;
details.time = base::Time::Now();
details.url = url;
details.content_language = content_language;
@@ -454,7 +454,8 @@ void TranslateHelper::CheckTranslateStatus(int page_seq_no) {
// First check if there was an error.
if (HasTranslationFailed()) {
// TODO(toyoshim): Check |errorCode| of translate.js and notify it here.
- NotifyBrowserTranslationFailed(TranslateErrors::TRANSLATION_ERROR);
+ NotifyBrowserTranslationFailed(
+ translate::TranslateErrors::TRANSLATION_ERROR);
return; // There was an error.
}
@@ -465,10 +466,12 @@ void TranslateHelper::CheckTranslateStatus(int page_seq_no) {
if (source_lang_ == kAutoDetectionLanguage) {
actual_source_lang = GetOriginalPageLanguage();
if (actual_source_lang.empty()) {
- NotifyBrowserTranslationFailed(TranslateErrors::UNKNOWN_LANGUAGE);
+ NotifyBrowserTranslationFailed(
+ translate::TranslateErrors::UNKNOWN_LANGUAGE);
return;
} else if (actual_source_lang == target_lang_) {
- NotifyBrowserTranslationFailed(TranslateErrors::IDENTICAL_LANGUAGES);
+ NotifyBrowserTranslationFailed(
+ translate::TranslateErrors::IDENTICAL_LANGUAGES);
return;
}
} else {
@@ -487,9 +490,11 @@ void TranslateHelper::CheckTranslateStatus(int page_seq_no) {
ExecuteScriptAndGetDoubleResult("cr.googleTranslate.translationTime"));
// Notify the browser we are done.
- render_view()->Send(new ChromeViewHostMsg_PageTranslated(
- render_view()->GetRoutingID(), actual_source_lang, target_lang_,
- TranslateErrors::NONE));
+ render_view()->Send(
+ new ChromeViewHostMsg_PageTranslated(render_view()->GetRoutingID(),
+ actual_source_lang,
+ target_lang_,
+ translate::TranslateErrors::NONE));
return;
}
@@ -510,7 +515,8 @@ void TranslateHelper::TranslatePageImpl(int page_seq_no, int count) {
// The library is not ready, try again later, unless we have tried several
// times unsucessfully already.
if (++count >= kMaxTranslateInitCheckAttempts) {
- NotifyBrowserTranslationFailed(TranslateErrors::INITIALIZATION_ERROR);
+ NotifyBrowserTranslationFailed(
+ translate::TranslateErrors::INITIALIZATION_ERROR);
return;
}
base::MessageLoop::current()->PostDelayedTask(
@@ -530,7 +536,8 @@ void TranslateHelper::TranslatePageImpl(int page_seq_no, int count) {
ExecuteScriptAndGetDoubleResult("cr.googleTranslate.loadTime"));
if (!StartTranslation()) {
- NotifyBrowserTranslationFailed(TranslateErrors::TRANSLATION_ERROR);
+ NotifyBrowserTranslationFailed(
+ translate::TranslateErrors::TRANSLATION_ERROR);
return;
}
// Check the status of the translation.
@@ -542,7 +549,7 @@ void TranslateHelper::TranslatePageImpl(int page_seq_no, int count) {
}
void TranslateHelper::NotifyBrowserTranslationFailed(
- TranslateErrors::Type error) {
+ translate::TranslateErrors::Type error) {
translation_pending_ = false;
// Notify the browser there was an error.
render_view()->Send(new ChromeViewHostMsg_PageTranslated(

Powered by Google App Engine
This is Rietveld 408576698