summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.cc
diff options
context:
space:
mode:
authorjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:14:06 +0000
committerjcivelli@google.com <jcivelli@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:14:06 +0000
commitd64b07bf98e4f27da4c22da6c615b75d4b2e16bc (patch)
tree345939445360af7d7ec3931ac8a839d5c08aa457 /chrome/renderer/render_view.cc
parent4bedba77d40df5fa5f1e00f5918123ee8711ca76 (diff)
downloadchromium_src-d64b07bf98e4f27da4c22da6c615b75d4b2e16bc.zip
chromium_src-d64b07bf98e4f27da4c22da6c615b75d4b2e16bc.tar.gz
chromium_src-d64b07bf98e4f27da4c22da6c615b75d4b2e16bc.tar.bz2
Translate now supports translating pages for which we
don't know the original language: if the browser specifies undefined for the source language, we use the translate element in the page to detect the language. BUG=40857 TEST=See bug. Review URL: http://codereview.chromium.org/1508030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45094 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_view.cc')
-rw-r--r--chrome/renderer/render_view.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 530a820..1aaf0a4 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -247,8 +247,8 @@ static const char* const kUnreachableWebDataURL =
static const char* const kBackForwardNavigationScheme = "history";
-// The string returned in DetectLanguage if we failed to detect the language.
-static const char* const kUnknownLanguageCode = "und";
+// static
+const char* const RenderView::kUnknownLanguageCode = "und";
static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) {
WebVector<WebURL> urls;
@@ -2548,6 +2548,9 @@ void RenderView::didCommitProvisionalLoad(WebFrame* frame,
// We bump our Page ID to correspond with the new session history entry.
page_id_ = next_page_id_++;
+ // Any pending translation is now obsolete.
+ translate_helper_.CancelPendingTranslation();
+
// Advance our offset in session history, applying the length limit. There
// is now no forward history.
history_list_offset_++;