summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 17:25:35 +0000
committerkuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 17:25:35 +0000
commit3450c47c2b62b3db03c3d3a873252072baecd40c (patch)
tree0ea764703789f241f21aa12dab748b5d36c1c111
parent99afaa77ff54c0ce39b6e3032a362aeade8aac4f (diff)
downloadchromium_src-3450c47c2b62b3db03c3d3a873252072baecd40c.zip
chromium_src-3450c47c2b62b3db03c3d3a873252072baecd40c.tar.gz
chromium_src-3450c47c2b62b3db03c3d3a873252072baecd40c.tar.bz2
en/dis-able conflicting translate infobar options
- if "always translate" options is checked, both "never translate" options are disabled - if either or both "never translate" options are checked, "always translate" option is disabled BUG=39174 TEST=verify per bug report. Review URL: http://codereview.chromium.org/1569004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43097 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/views/infobars/translate_infobars.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/views/infobars/translate_infobars.cc b/chrome/browser/views/infobars/translate_infobars.cc
index 040642e..3bebe90 100644
--- a/chrome/browser/views/infobars/translate_infobars.cc
+++ b/chrome/browser/views/infobars/translate_infobars.cc
@@ -706,6 +706,19 @@ bool TranslateInfoBar::IsCommandIdChecked(int command_id) const {
}
bool TranslateInfoBar::IsCommandIdEnabled(int command_id) const {
+ TranslateInfoBarDelegate* translate_delegate = GetDelegate();
+ switch (command_id) {
+ case IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_LANG :
+ case IDC_TRANSLATE_OPTIONS_NEVER_TRANSLATE_SITE :
+ return !translate_delegate->ShouldAlwaysTranslate();
+
+ case IDC_TRANSLATE_OPTIONS_ALWAYS :
+ return (!translate_delegate->IsLanguageBlacklisted() &&
+ !translate_delegate->IsSiteBlacklisted());
+
+ default:
+ break;
+ }
return true;
}