summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate/translate_infobar_delegate.h
diff options
context:
space:
mode:
authormiguelg@chromium.org <miguelg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 18:11:10 +0000
committermiguelg@chromium.org <miguelg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-25 18:11:10 +0000
commitf1717965f238e93f93afabea5be47b50aeda9ae0 (patch)
tree1db5256680011af1baac8b471eec32855a9ee9e8 /chrome/browser/translate/translate_infobar_delegate.h
parent817b3f139dee0ed64954cc06e3c3c53630ef8f1f (diff)
downloadchromium_src-f1717965f238e93f93afabea5be47b50aeda9ae0.zip
chromium_src-f1717965f238e93f93afabea5be47b50aeda9ae0.tar.gz
chromium_src-f1717965f238e93f93afabea5be47b50aeda9ae0.tar.bz2
[Translate] Translate delegate shortcut configuration
Allow platform specific configurations to decide when to trigger the extra buttons (now shortcuts) BUG=234416 TBR=rohitrao,sky,erg Review URL: https://chromiumcodereview.appspot.com/14188047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate/translate_infobar_delegate.h')
-rw-r--r--chrome/browser/translate/translate_infobar_delegate.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/translate/translate_infobar_delegate.h b/chrome/browser/translate/translate_infobar_delegate.h
index 3518506..5ac5986 100644
--- a/chrome/browser/translate/translate_infobar_delegate.h
+++ b/chrome/browser/translate/translate_infobar_delegate.h
@@ -18,6 +18,13 @@
class PrefService;
+// The defaults after which extra shortcuts for options
+// can be shown.
+struct ShortcutConfiguration {
+ int always_translate_min_count;
+ int never_translate_min_count;
+};
+
class TranslateInfoBarDelegate : public InfoBarDelegate {
public:
// The different types of infobars that can be shown for translation.
@@ -57,6 +64,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
Type infobar_type,
TranslateErrors::Type error_type,
PrefService* prefs,
+ const ShortcutConfiguration& shortcut_config,
const std::string& original_language,
const std::string& target_language);
@@ -140,10 +148,12 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
bool ShouldShowMessageInfoBarButton();
// Called by the before translate infobar to figure-out if it should show
- // an extra button to let the user black-list/white-list that language (based
- // on how many times the user accepted/declined translation).
- bool ShouldShowNeverTranslateButton();
- bool ShouldShowAlwaysTranslateButton();
+ // an extra shortcut to let the user black-list/white-list that language
+ // (based on how many times the user accepted/declined translation).
+ // The shortcut itself is platform specific, it can be a button or a new bar
+ // for example.
+ bool ShouldShowNeverTranslateShortcut();
+ bool ShouldShowAlwaysTranslateShortcut();
// Sets this infobar background animation based on the previous infobar shown.
// A fading background effect is used when transitioning from a normal state
@@ -170,6 +180,7 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
TranslateErrors::Type error_type,
InfoBarService* infobar_service,
PrefService* prefs,
+ ShortcutConfiguration shortcut_config,
const std::string& original_language,
const std::string& target_language);
Type infobar_type_;
@@ -219,6 +230,8 @@ class TranslateInfoBarDelegate : public InfoBarDelegate {
// The translation related preferences.
TranslatePrefs prefs_;
+ // Translation shortcut configuration
+ ShortcutConfiguration shortcut_config_;
DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate);
};