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