diff options
author | hajimehoshi@chromium.org <hajimehoshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-17 10:29:43 +0000 |
---|---|---|
committer | hajimehoshi@chromium.org <hajimehoshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-17 10:29:43 +0000 |
commit | f9db7e080035f6b8d253d4926c8e53ad03c0a581 (patch) | |
tree | a9dd488c6e2a2b7b6e3839fd209a6b47903fee59 /chrome/browser/translate/translate_manager.h | |
parent | f3f3c0ba8ae39786d12c9c4dbd11dbb2940351f2 (diff) | |
download | chromium_src-f9db7e080035f6b8d253d4926c8e53ad03c0a581.zip chromium_src-f9db7e080035f6b8d253d4926c8e53ad03c0a581.tar.gz chromium_src-f9db7e080035f6b8d253d4926c8e53ad03c0a581.tar.bz2 |
Translate: Changed the rule to determine which language should be translated
Along with changing the UI, the flow sholud be changed. Currently, a page in an Accept language is not translated. After the new UI, a page in an Accept language MAY be translated.
Current:
1) If a language is listed in Accept languages, the page should not be translated.
2) If a language is blacklisted by prefs, the page should not be translated.
3) Otherwise, the page may be translated.
After this CL (with switches::kEnableTranslateSettings):
1) If a language is blacklisted by prefs, and if 1.1) or 1.2), the page should not be translated.
1.1) the language is listed in Accept languages
1.2) the language cannot be Accept languages
2) Otherwise, the page may be translated.
Design Doc: https://docs.google.com/a/google.com/document/d/1mxM00l1h2e59HKPVZR_1DY07jeCg4RwHWu7JDvmWx3w/edit
BUG=243235
TBR=hajimehoshi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16530004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206697 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_manager.h')
-rw-r--r-- | chrome/browser/translate/translate_manager.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h index d5feea6..b00f444 100644 --- a/chrome/browser/translate/translate_manager.h +++ b/chrome/browser/translate/translate_manager.h @@ -24,6 +24,7 @@ class GURL; struct LanguageDetectionDetails; struct PageTranslatedDetails; class PrefService; +class Profile; struct ShortcutConfiguration; class TranslateAcceptLanguages; struct TranslateErrorDetails; @@ -74,6 +75,9 @@ class TranslateManager : public content::NotificationObserver, // alpha language. static bool IsAlphaLanguage(const std::string& language); + // Returns true if |language| is an Accept language for the user profile. + static bool IsAcceptLanguage(Profile* profile, const std::string& language); + // Let the caller decide if and when we should fetch the language list from // the translate server. This is a NOOP if switches::kDisableTranslate is set // or if prefs::kEnableTranslate is set to false. |