diff options
-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)); |