Index: components/translate/core/browser/translate_infobar_delegate.h |
diff --git a/components/translate/core/browser/translate_infobar_delegate.h b/components/translate/core/browser/translate_infobar_delegate.h |
index 6a8a77b94dbb3de095bcfff8d57f2ea1170a0868..cb4a7bc4c002d5b10f99137629fe1d2a025ac689 100644 |
--- a/components/translate/core/browser/translate_infobar_delegate.h |
+++ b/components/translate/core/browser/translate_infobar_delegate.h |
@@ -37,6 +37,19 @@ class TranslateManager; |
class TranslateInfoBarDelegate : public infobars::InfoBarDelegate { |
public: |
+ // A responder to handle different translate steps' UI changes. |
+ class Responder { |
+ public: |
+ // Handles UI changes on the translate step given. |
+ virtual void ActionOnStep(translate::TranslateStep step, |
+ TranslateErrors::Type error_type){}; |
+ // Return whether user declined translate service. |
+ virtual bool Declined(); |
+ |
+ protected: |
+ virtual ~Responder() {} |
+ }; |
+ |
static const size_t kNoIndex; |
~TranslateInfoBarDelegate() override; |
@@ -182,6 +195,9 @@ class TranslateInfoBarDelegate : public infobars::InfoBarDelegate { |
// May return NULL if the driver has been destroyed. |
TranslateDriver* GetTranslateDriver(); |
+ // Set a responder. |
+ void SetResponder(Responder* responder); |
+ |
protected: |
TranslateInfoBarDelegate( |
const base::WeakPtr<TranslateManager>& translate_manager, |
@@ -219,6 +235,10 @@ class TranslateInfoBarDelegate : public infobars::InfoBarDelegate { |
// (due to language detection, preferences...) |
bool triggered_from_menu_; |
+ // A responder to handle front-end changes on different steps. |
+ // It's only used when we try to reuse the existing UI. |
+ Responder* responder_; |
napper
2017/05/19 00:17:50
Responder* const responder_;
Leo
2017/05/19 03:30:24
We can talk this offline.
|
+ |
DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarDelegate); |
}; |