diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-26 17:42:13 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-26 17:42:13 +0000 |
commit | 0908acd972c01bf7f3915575b5b53d78a0ee3c7b (patch) | |
tree | 82fd2d2b47c3e5226840e9a6c651ddea0d89ef11 /chrome/browser/translate/translate_manager.cc | |
parent | cab7a1afc7edf2a78154b7dc3a42218d943d8195 (diff) | |
download | chromium_src-0908acd972c01bf7f3915575b5b53d78a0ee3c7b.zip chromium_src-0908acd972c01bf7f3915575b5b53d78a0ee3c7b.tar.gz chromium_src-0908acd972c01bf7f3915575b5b53d78a0ee3c7b.tar.bz2 |
Adding a preference to turn off the translate feature.
BUG=None
TEST=Visit a page in a language other than the Chrome's language.
A translate infobar should be shown.
In the options/Under the Hood tab, unselect "Offer to translate
pages that aren't in a language I read". Navigate again to a
page in a non Chrome-UI language. No translate infobar should be
shown.
Review URL: http://codereview.chromium.org/661095
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40128 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_manager.cc')
-rw-r--r-- | chrome/browser/translate/translate_manager.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index d1ee940..8c90bdf 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -134,6 +134,9 @@ TranslateManager::TranslateManager() void TranslateManager::InitiateTranslation(TabContents* tab, const std::string& page_lang) { PrefService* prefs = tab->profile()->GetPrefs(); + if (!prefs->GetBoolean(prefs::kEnableTranslate)) + return; + NavigationEntry* entry = tab->controller().GetActiveEntry(); if (!entry) { NOTREACHED(); |