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

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

Issue 552216: This CL makes the TranslationService class send the text to be translated to ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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/page_translator.cc
===================================================================
--- chrome/renderer/translate/page_translator.cc (revision 37411)
+++ chrome/renderer/translate/page_translator.cc (working copy)
@@ -16,6 +16,8 @@
#include "third_party/WebKit/WebKit/chromium/public/WebNodeList.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
+namespace {
+
// The following elements are not supposed to be translated.
const char* const kSkippedTags[] = { "APPLET", "AREA", "BASE", "FRAME",
"FRAMESET", "HR", "IFRAME", "IMG", "INPUT", "LINK", "META", "MAP",
@@ -25,6 +27,7 @@
// Notes: does SPAN belong to this list?
const char* const kInlineTags[] = { "A", "ABBR", "ACRONYM", "B", "BIG", "DEL",
"EM", "I", "INS", "S", "SPAN", "STRIKE", "STRONG", "SUB", "SUP", "U" };
+}
// Returns true when s1 < s2.
bool PageTranslator::WebStringCompare::operator()(
@@ -115,7 +118,8 @@
int work_id, const std::vector<string16>& translated_text_chunks) {
std::map<int, NodeList*>::iterator iter = pending_translations_.find(work_id);
if (iter == pending_translations_.end()) {
- NOTREACHED() << "Translation results received for unknown node zone";
+ // We received some translated text we were not expecting. It could be we
+ // navigated away from the page or that the translation was undone.
return;
}

Powered by Google App Engine
This is Rietveld 408576698