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" | 10 #include "base/android/jni_weak_ref.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Acquire the java infobar from a different one. This is used to do in-place | 67 // Acquire the java infobar from a different one. This is used to do in-place |
68 // replacements. | 68 // replacements. |
69 virtual void PassJavaInfoBar(InfoBarAndroid* source) {} | 69 virtual void PassJavaInfoBar(InfoBarAndroid* source) {} |
70 | 70 |
71 protected: | 71 protected: |
72 // Derived classes must implement this method to process the corresponding | 72 // Derived classes must implement this method to process the corresponding |
73 // action. | 73 // action. |
74 virtual void ProcessButton(int action, | 74 virtual void ProcessButton(int action, |
75 const std::string& action_value) = 0; | 75 const std::string& action_value) = 0; |
76 void CloseInfoBar(); | 76 void CloseInfoBar(); |
| 77 InfoBarAndroid* infobar_android() { return this; } |
77 | 78 |
78 private: | 79 private: |
79 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; | 80 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; |
80 | 81 |
81 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); | 82 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); |
82 }; | 83 }; |
83 | 84 |
84 // Registers the NativeInfoBar's native methods through JNI. | 85 // Registers the NativeInfoBar's native methods through JNI. |
85 bool RegisterNativeInfoBar(JNIEnv* env); | 86 bool RegisterNativeInfoBar(JNIEnv* env); |
86 | 87 |
87 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ | 88 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ |
OLD | NEW |