diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 15:48:37 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 15:48:37 +0000 |
commit | 5ddfd63e1be6378721913af1f26fa1d4cbf09c5d (patch) | |
tree | 01af8f99ac0a2deaf6e63caea891a736bfa4fde1 /chrome/renderer/translate_helper.h | |
parent | 203c78635602da82ca215b188362c85d60fc306a (diff) | |
download | chromium_src-5ddfd63e1be6378721913af1f26fa1d4cbf09c5d.zip chromium_src-5ddfd63e1be6378721913af1f26fa1d4cbf09c5d.tar.gz chromium_src-5ddfd63e1be6378721913af1f26fa1d4cbf09c5d.tar.bz2 |
This CL ensures we use the language specified in the language meta tag if any.
Also IsPageTranslatable was moved to TranslateHelper as it is where it belongs.
BUG=51454
TEST=Run the browser tests.
Review URL: http://codereview.chromium.org/3236008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/translate_helper.h')
-rw-r--r-- | chrome/renderer/translate_helper.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/renderer/translate_helper.h b/chrome/renderer/translate_helper.h index bec9e02..0e3a989 100644 --- a/chrome/renderer/translate_helper.h +++ b/chrome/renderer/translate_helper.h @@ -13,6 +13,7 @@ class RenderView; namespace WebKit { +class WebDocument; class WebFrame; } @@ -39,6 +40,18 @@ class TranslateHelper { // revert existing translations. void CancelPendingTranslation(); + // 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 IsPageTranslatable(WebKit::WebDocument* document); + + // Returns the language specified in the language meta tag of |document|, or + // an empty string if no such tag was found. + // The tag may specify several languages, the first one is returned. + // Example of such meta-tag: + // <meta http-equiv="content-language" content="en, fr"> + static std::string GetPageLanguageFromMetaTag(WebKit::WebDocument* document); + protected: // The following methods are protected so they can be overridden in // unit-tests. |