Index: chrome/browser/ui/android/infobars/translate_compact_infobar.h |
diff --git a/chrome/browser/ui/android/infobars/translate_compact_infobar.h b/chrome/browser/ui/android/infobars/translate_compact_infobar.h |
index aeabb616fe27b7a9b09335e18414955f6212d4bf..b94ed7c0727429a2ce477ba819e23058ef34fdb5 100644 |
--- a/chrome/browser/ui/android/infobars/translate_compact_infobar.h |
+++ b/chrome/browser/ui/android/infobars/translate_compact_infobar.h |
@@ -9,7 +9,9 @@ |
#include "base/macros.h" |
#include "chrome/browser/translate/chrome_translate_client.h" |
#include "chrome/browser/ui/android/infobars/infobar_android.h" |
-#include "components/translate/content/browser/content_translate_driver.h" |
+#include "components/translate/core/browser/translate_infobar_delegate.h" |
+#include "components/translate/core/browser/translate_step.h" |
+#include "components/translate/core/common/translate_errors.h" |
namespace translate { |
class TranslateInfoBarDelegate; |
@@ -17,7 +19,7 @@ class TranslateInfoBarDelegate; |
class TranslateCompactInfoBar |
: public InfoBarAndroid, |
- public translate::ContentTranslateDriver::Observer { |
+ public translate::TranslateInfoBarDelegate::Responder { |
public: |
explicit TranslateCompactInfoBar( |
std::unique_ptr<translate::TranslateInfoBarDelegate> delegate); |
@@ -44,10 +46,10 @@ class TranslateCompactInfoBar |
JNIEnv* env, |
const base::android::JavaParamRef<jobject>& obj); |
- // ContentTranslateDriver::Observer implementation. |
- void OnPageTranslated(const std::string& original_lang, |
- const std::string& translated_lang, |
- translate::TranslateErrors::Type error_type) override; |
+ // TranslateInfoBarDelegate::Responder implementation. |
+ void ActionOnStep(translate::TranslateStep step, |
+ translate::TranslateErrors::Type error_type) override; |
+ bool Declined() override; |
private: |
// InfoBarAndroid: |
@@ -58,7 +60,16 @@ class TranslateCompactInfoBar |
const base::android::JavaRef<jobject>& java_info_bar) override; |
translate::TranslateInfoBarDelegate* GetDelegate(); |
- translate::ContentTranslateDriver* translate_driver_; |
+ |
+ // Bits for trace user actions. |
+ unsigned int action_flags; |
napper
2017/05/19 00:17:50
action_flags_;
Leo
2017/05/19 03:30:23
Acknowledged.
|
+ |
+ // Action flags |
napper
2017/05/19 00:17:50
Add '.' at end of comment
Leo
2017/05/19 03:30:24
Acknowledged.
|
+ const int FLAG_TRANSLATE = 1 << 0; |
napper
2017/05/19 00:17:50
Consider making these an enum
Leo
2017/05/19 03:30:24
Done.
|
+ const int FLAG_REVERT = 1 << 1; |
+ const int FLAG_ALWAYS_TRANSLATE = 1 << 2; |
+ const int FLAG_NEVER_LANGUAGE = 1 << 3; |
+ const int FLAG_NEVER_SITE = 1 << 4; |
// If number of consecutive translations is equal to this number, infobar will |
// automatically trigger "Always Translate". |