diff options
Diffstat (limited to 'chrome/browser/translate/translate_infobar_delegate2.h')
-rw-r--r-- | chrome/browser/translate/translate_infobar_delegate2.h | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/chrome/browser/translate/translate_infobar_delegate2.h b/chrome/browser/translate/translate_infobar_delegate2.h index 14c683a..7b5f691 100644 --- a/chrome/browser/translate/translate_infobar_delegate2.h +++ b/chrome/browser/translate/translate_infobar_delegate2.h @@ -19,28 +19,33 @@ class TranslateInfoBarDelegate2 : public InfoBarDelegate { public: // The different types of infobars that can be shown for translation. enum Type { - BEFORE_TRANSLATE, - TRANSLATING, - AFTER_TRANSLATE, - TRANSLATION_ERROR + kBeforeTranslate, + kTranslating, + kAfterTranslate, + kTranslationError }; // The types of background color animations. enum BackgroundAnimationType { - NONE, - NORMAL_TO_ERROR, - ERROR_TO_NORMAL + kNone, + kNormalToError, + kErrorToNormal }; - // Factory method. + // Factory method to create a non-error translate infobar. // The original and target language specified are the ASCII language codes // (ex: en, fr...). // Returns NULL if it failed, typically if |original_language| or // |target_language| is not a supported language. - // |error| should be set to NONE if |infobar_type| is not TRANSLATION_ERROR. - static TranslateInfoBarDelegate2* CreateInstance( + static TranslateInfoBarDelegate2* CreateDelegate( Type infobar_type, - TranslateErrors::Type error, + TabContents* tab_contents, + const std::string& original_language, + const std::string& target_language); + + // Factory method to create an error translate infobar. + static TranslateInfoBarDelegate2* CreateErrorDelegate( + TranslateErrors::Type error_type, TabContents* tab_contents, const std::string& original_language, const std::string& target_language); @@ -58,6 +63,8 @@ class TranslateInfoBarDelegate2 : public InfoBarDelegate { Type type() const { return type_; } + TranslateErrors::Type error() const { return error_; } + int original_language_index() const { return original_language_index_; } int target_language_index() const { return target_language_index_; } |