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

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

Issue 15728002: Translate: adopt html lang attribute if valid value is provided (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix WindowOpenClose crash Created 7 years, 7 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 | « no previous file | chrome/renderer/translate/translate_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/translate/translate_helper.h
diff --git a/chrome/renderer/translate/translate_helper.h b/chrome/renderer/translate/translate_helper.h
index eebc9ff040209c72ab7da8740d28013ab6ccb238..6c6662c4805fc44f259057ea250799a532353318 100644
--- a/chrome/renderer/translate/translate_helper.h
+++ b/chrome/renderer/translate/translate_helper.h
@@ -96,18 +96,23 @@ class TranslateHelper : public content::RenderViewObserver {
CLDAgreeWithLanguageCodeHavingCountryCode);
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest,
InvalidLanguageMetaTagProviding);
+ FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, AdoptHtmlLang);
- // Correct language code if it contains well-known mistakes.
+ // Corrects language code if it contains well-known mistakes.
static void CorrectLanguageCodeTypo(std::string* code);
- // Convert language code to the one used in server supporting list.
+ // Converts language code to the one used in server supporting list.
static void ConvertLanguageCodeSynonym(std::string* code);
- // Reset language code if the specified string is apparently invalid.
+ // Resets language code if the specified string is apparently invalid.
static void ResetInvalidLanguageCode(std::string* code);
- // Determine content page language from Content-Language code and contents.
+ // Applies a series of language code modification in proper order.
+ static void ApplyLanguageCodeCorrection(std::string* code);
+
+ // Determines content page language from Content-Language code and contents.
static std::string DeterminePageLanguage(const std::string& code,
+ const std::string& html_lang,
const string16& contents,
std::string* cld_language,
bool* is_cld_reliable);
« no previous file with comments | « no previous file | chrome/renderer/translate/translate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698