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

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

Issue 2900603003: Successful translation erroneously reported on page with too little text (Closed)
Patch Set: Fixed a nit Created 3 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
« no previous file with comments | « components/translate/core/browser/language_state.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/translate/core/browser/translate_manager.cc
diff --git a/components/translate/core/browser/translate_manager.cc b/components/translate/core/browser/translate_manager.cc
index 089c6137cd1d00eda469fa923184ecb86f2ba540..f38b7a78900f7b6dc4d752ba2edfff5dc2238a83 100644
--- a/components/translate/core/browser/translate_manager.cc
+++ b/components/translate/core/browser/translate_manager.cc
@@ -427,8 +427,11 @@ void TranslateManager::NotifyTranslateError(TranslateErrors::Type error_type) {
void TranslateManager::PageTranslated(const std::string& source_lang,
const std::string& target_lang,
TranslateErrors::Type error_type) {
- language_state_.SetCurrentLanguage(target_lang);
+ if (error_type == TranslateErrors::NONE)
+ language_state_.SetCurrentLanguage(target_lang);
+
language_state_.set_translation_pending(false);
+ language_state_.set_translation_error(error_type != TranslateErrors::NONE);
if ((error_type == TranslateErrors::NONE) &&
source_lang != translate::kUnknownLanguageCode &&
« no previous file with comments | « components/translate/core/browser/language_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698