diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 20:49:44 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 20:49:44 +0000 |
commit | 791f7693529ae34db21b6b3c3b78231b2f29dc7b (patch) | |
tree | 28a3f72a61b7bfad7119247fa78b72cb4a11b660 | |
parent | 74f8f030cefd8118cc97e3d77546fb900ad9403e (diff) | |
download | chromium_src-791f7693529ae34db21b6b3c3b78231b2f29dc7b.zip chromium_src-791f7693529ae34db21b6b3c3b78231b2f29dc7b.tar.gz chromium_src-791f7693529ae34db21b6b3c3b78231b2f29dc7b.tar.bz2 |
Don't show preference related menus in the translate infobar in incognito mode.
BUG=51214
TEST=Navigate in a non incognito window to www.google.de. The translate infobar should show. The options menu should have options to always/never translate german.
Navigate again to that page but from an incognito window, the options menu in the translate infobar should not have any preference (always/never translate) related items.
Review URL: http://codereview.chromium.org/3073025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55777 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/translate/options_menu_model.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc index cd1ae2e..56b707b 100644 --- a/chrome/browser/translate/options_menu_model.cc +++ b/chrome/browser/translate/options_menu_model.cc @@ -8,6 +8,7 @@ #include "base/histogram.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/translate/translate_infobar_delegate.h" #include "grit/generated_resources.h" @@ -23,17 +24,20 @@ OptionsMenuModel::OptionsMenuModel( translate_delegate->target_language_index()); // Populate the menu. - AddCheckItem(IDC_TRANSLATE_OPTIONS_ALWAYS, - l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS, - original_language, target_language)); - AddCheckItem(IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_LANG, - l10n_util::GetStringFUTF16( - IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_LANG, - original_language)); - AddCheckItem(IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_SITE, - l10n_util::GetStringUTF16( - IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_SITE)); - AddSeparator(); + // Incognito mode does not get any preferences related items. + if (!translate_delegate->tab_contents()->profile()->IsOffTheRecord()) { + AddCheckItem(IDC_TRANSLATE_OPTIONS_ALWAYS, + l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS, + original_language, target_language)); + AddCheckItem(IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_LANG, + l10n_util::GetStringFUTF16( + IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_LANG, + original_language)); + AddCheckItem(IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_SITE, + l10n_util::GetStringUTF16( + IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_SITE)); + AddSeparator(); + } AddItem(IDC_TRANSLATE_REPORT_BAD_LANGUAGE_DETECTION, l10n_util::GetStringFUTF16(IDS_TRANSLATE_INFOBAR_OPTIONS_REPORT_ERROR, original_language)); |