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

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

Issue 18911002: Move language detection to chrome/common/. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 5 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 | « chrome/renderer/DEPS ('k') | 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 21fbcaaa197aefcf113dd6333ac34bd640c86bec..3b7273f3725ac4b8c64ac93d4f3821fd55cbbdb6 100644
--- a/chrome/renderer/translate/translate_helper.h
+++ b/chrome/renderer/translate/translate_helper.h
@@ -87,7 +87,6 @@ class TranslateHelper : public content::RenderViewObserver {
virtual double ExecuteScriptAndGetDoubleResult(const std::string& script);
private:
- FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, IsValidLanguageCode);
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, AdoptHtmlLang);
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest,
CLDAgreeWithLanguageCodeHavingCountryCode);
@@ -101,55 +100,14 @@ class TranslateHelper : public content::RenderViewObserver {
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, SimilarLanguageCode);
FRIEND_TEST_ALL_PREFIXES(TranslateHelperTest, WellKnownWrongConfiguration);
- // Corrects language code if it contains well-known mistakes.
- static void CorrectLanguageCodeTypo(std::string* code);
-
// Converts language code to the one used in server supporting list.
static void ConvertLanguageCodeSynonym(std::string* code);
- // Checks if the language code's format is valid.
- static bool IsValidLanguageCode(const std::string& code);
-
- // Applies a series of language code modification in proper order.
- static void ApplyLanguageCodeCorrection(std::string* code);
-
- // Checks if languages are matched, or similar. This function returns true
- // against a language pair containing a language which is difficult for CLD
- // to distinguish.
- static bool IsSameOrSimilarLanguages(const std::string& page_language,
- const std::string& cld_language);
-
- // Checks if languages pair is one of well-known pairs of wrong server
- // configuration.
- static bool MaybeServerWrongConfiguration(const std::string& page_language,
- const std::string& cld_language);
-
- // Checks if CLD can complement a sub code when the page language doesn't
- // know the sub code.
- static bool CanCLDComplementSubCode(const std::string& page_language,
- const std::string& cld_language);
-
- // 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);
-
// Returns whether the page associated with |document| is a candidate for
// translation. Some pages can explictly specify (via a meta-tag) that they
// should not be translated.
static bool IsTranslationAllowed(WebKit::WebDocument* document);
-#if defined(ENABLE_LANGUAGE_DETECTION)
- // Returns the ISO 639_1 language code of the specified |text|, or 'unknown'
- // if it failed.
- // |is_cld_reliable| will be set as true if CLD says the detection is
- // reliable.
- static std::string DetermineTextLanguage(const string16& text,
- bool* is_cld_reliable);
-#endif
-
// RenderViewObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
« no previous file with comments | « chrome/renderer/DEPS ('k') | chrome/renderer/translate/translate_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698