OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_TRANSLATE_COMPACT_INFOBAR_H_ |
| 7 |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/macros.h" |
| 10 #include "chrome/browser/translate/chrome_translate_client.h" |
| 11 #include "chrome/browser/ui/android/infobars/infobar_android.h" |
| 12 |
| 13 namespace translate { |
| 14 class TranslateInfoBarDelegate; |
| 15 } |
| 16 |
| 17 class TranslateCompactInfoBar : public InfoBarAndroid { |
| 18 public: |
| 19 explicit TranslateCompactInfoBar( |
| 20 std::unique_ptr<translate::TranslateInfoBarDelegate> delegate); |
| 21 ~TranslateCompactInfoBar() override; |
| 22 |
| 23 // JNI methods specific to translate. |
| 24 void ApplyTranslateOptions(JNIEnv* env, |
| 25 const base::android::JavaParamRef<jobject>& obj); |
| 26 |
| 27 private: |
| 28 // InfoBarAndroid: |
| 29 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( |
| 30 JNIEnv* env) override; |
| 31 void ProcessButton(int action) override; |
| 32 void SetJavaInfoBar( |
| 33 const base::android::JavaRef<jobject>& java_info_bar) override; |
| 34 |
| 35 translate::TranslateInfoBarDelegate* GetDelegate(); |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(TranslateCompactInfoBar); |
| 38 }; |
| 39 |
| 40 // Registers the native methods through JNI. |
| 41 bool RegisterTranslateCompactInfoBar(JNIEnv* env); |
| 42 |
| 43 #endif |
OLD | NEW |