| 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_INFOBAR_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/android/jni_weak_ref.h" | |
| 11 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/compiler_specific.h" | |
| 13 #include "base/macros.h" | 11 #include "base/macros.h" |
| 14 #include "components/infobars/core/infobar.h" | 12 #include "components/infobars/core/infobar.h" |
| 15 | 13 |
| 16 class InfoBarService; | 14 class InfoBarService; |
| 17 | 15 |
| 18 namespace infobars { | 16 namespace infobars { |
| 19 class InfoBarDelegate; | 17 class InfoBarDelegate; |
| 20 } | 18 } |
| 21 | 19 |
| 22 class InfoBarAndroid : public infobars::InfoBar { | 20 class InfoBarAndroid : public infobars::InfoBar { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 bool HasSetJavaInfoBar() const; | 49 bool HasSetJavaInfoBar() const; |
| 52 | 50 |
| 53 // Tells the Java-side counterpart of this InfoBar to point to the replacement | 51 // Tells the Java-side counterpart of this InfoBar to point to the replacement |
| 54 // InfoBar instead of this one. | 52 // InfoBar instead of this one. |
| 55 void ReassignJavaInfoBar(InfoBarAndroid* replacement); | 53 void ReassignJavaInfoBar(InfoBarAndroid* replacement); |
| 56 | 54 |
| 57 virtual void OnLinkClicked(JNIEnv* env, | 55 virtual void OnLinkClicked(JNIEnv* env, |
| 58 const base::android::JavaParamRef<jobject>& obj) {} | 56 const base::android::JavaParamRef<jobject>& obj) {} |
| 59 void OnButtonClicked(JNIEnv* env, | 57 void OnButtonClicked(JNIEnv* env, |
| 60 const base::android::JavaParamRef<jobject>& obj, | 58 const base::android::JavaParamRef<jobject>& obj, |
| 61 jint action); | 59 jint action, |
| 60 jboolean persist); |
| 62 void OnCloseButtonClicked(JNIEnv* env, | 61 void OnCloseButtonClicked(JNIEnv* env, |
| 63 const base::android::JavaParamRef<jobject>& obj); | 62 const base::android::JavaParamRef<jobject>& obj); |
| 64 | 63 |
| 65 void CloseJavaInfoBar(); | 64 void CloseJavaInfoBar(); |
| 66 | 65 |
| 67 // Maps from a Chromium ID (IDR_TRANSLATE) to a enum value that Java code can | 66 // Maps from a Chromium ID (IDR_TRANSLATE) to a enum value that Java code can |
| 68 // translate into a Drawable ID using the ResourceId class. | 67 // translate into a Drawable ID using the ResourceId class. |
| 69 int GetEnumeratedIconId(); | 68 int GetEnumeratedIconId(); |
| 70 | 69 |
| 71 // Acquire the java infobar from a different one. This is used to do in-place | 70 // Acquire the java infobar from a different one. This is used to do in-place |
| (...skipping 11 matching lines...) Expand all Loading... |
| 83 private: | 82 private: |
| 84 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; | 83 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; |
| 85 | 84 |
| 86 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); | 85 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); |
| 87 }; | 86 }; |
| 88 | 87 |
| 89 // Registers the NativeInfoBar's native methods through JNI. | 88 // Registers the NativeInfoBar's native methods through JNI. |
| 90 bool RegisterNativeInfoBar(JNIEnv* env); | 89 bool RegisterNativeInfoBar(JNIEnv* env); |
| 91 | 90 |
| 92 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ | 91 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ |
| OLD | NEW |