summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/translate_helper.h
diff options
context:
space:
mode:
authorhajimehoshi@chromium.org <hajimehoshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-13 13:04:27 +0000
committerhajimehoshi@chromium.org <hajimehoshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-13 13:04:27 +0000
commit1d3310e36f56dd28d8a72b64d814f4c2095434fb (patch)
tree87062256e3140f074820c38b99f53dbbfc2a6d66 /chrome/renderer/translate_helper.h
parentbc25c4d71b8838e5959ea4bdebcafbde36686a8a (diff)
downloadchromium_src-1d3310e36f56dd28d8a72b64d814f4c2095434fb.zip
chromium_src-1d3310e36f56dd28d8a72b64d814f4c2095434fb.tar.gz
chromium_src-1d3310e36f56dd28d8a72b64d814f4c2095434fb.tar.bz2
When a language which was set by content-language of meta tag and this language was invalid (ex. utf-8), the browser didn't use the language guessed by CLD and the infobar for translation didn't appear. The reason is because CLD's language was adopted only if meta-tag's language was empty. This patch fixed this problem to sanitize meta-tag's language before determining to adopt CLD's language.
BUG=180199 Review URL: https://chromiumcodereview.appspot.com/12478004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187842 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/translate_helper.h')
-rw-r--r--chrome/renderer/translate_helper.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/chrome/renderer/translate_helper.h b/chrome/renderer/translate_helper.h
index 22b8098..8ddc63f 100644
--- a/chrome/renderer/translate_helper.h
+++ b/chrome/renderer/translate_helper.h
@@ -71,6 +71,8 @@ class TranslateHelper : public content::RenderViewObserver {
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, ResetInvalidLanguageCode);
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest,
CLDDisagreeWithWrongLanguageCode);
+ FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest,
+ InvalidLanguageMetaTagProviding);
// Correct language code if it contains well-known mistakes.
static void CorrectLanguageCodeTypo(std::string* code);