| 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_helper.h" | 10 #include "base/android/jni_helper.h" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "chrome/browser/infobars/infobar.h" | 14 #include "components/infobars/core/infobar.h" |
| 15 | 15 |
| 16 class InfoBarDelegate; | |
| 17 class InfoBarService; | 16 class InfoBarService; |
| 18 | 17 |
| 19 class InfoBarAndroid : public InfoBar { | 18 namespace infobars { |
| 19 class InfoBarDelegate; |
| 20 } |
| 21 |
| 22 class InfoBarAndroid : public infobars::InfoBar { |
| 20 public: | 23 public: |
| 21 | 24 |
| 22 // Make sure this set of values is aligned with the java constants defined in | 25 // Make sure this set of values is aligned with the java constants defined in |
| 23 // InfoBar.java! | 26 // InfoBar.java! |
| 24 enum ActionType { | 27 enum ActionType { |
| 25 ACTION_NONE = 0, | 28 ACTION_NONE = 0, |
| 26 // Confirm infobar | 29 // Confirm infobar |
| 27 ACTION_OK = 1, | 30 ACTION_OK = 1, |
| 28 ACTION_CANCEL = 2, | 31 ACTION_CANCEL = 2, |
| 29 // Translate infobar | 32 // Translate infobar |
| 30 ACTION_TRANSLATE = 3, | 33 ACTION_TRANSLATE = 3, |
| 31 ACTION_TRANSLATE_SHOW_ORIGINAL = 4, | 34 ACTION_TRANSLATE_SHOW_ORIGINAL = 4, |
| 32 }; | 35 }; |
| 33 | 36 |
| 34 explicit InfoBarAndroid(scoped_ptr<InfoBarDelegate> delegate); | 37 explicit InfoBarAndroid(scoped_ptr<infobars::InfoBarDelegate> delegate); |
| 35 virtual ~InfoBarAndroid(); | 38 virtual ~InfoBarAndroid(); |
| 36 | 39 |
| 37 // InfoBar: | 40 // InfoBar: |
| 38 virtual base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( | 41 virtual base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( |
| 39 JNIEnv* env) = 0; | 42 JNIEnv* env) = 0; |
| 40 | 43 |
| 41 void set_java_infobar(const base::android::JavaRef<jobject>& java_info_bar); | 44 void set_java_infobar(const base::android::JavaRef<jobject>& java_info_bar); |
| 42 bool HasSetJavaInfoBar() const; | 45 bool HasSetJavaInfoBar() const; |
| 43 | 46 |
| 44 // Tells the Java-side counterpart of this InfoBar to point to the replacement | 47 // Tells the Java-side counterpart of this InfoBar to point to the replacement |
| (...skipping 27 matching lines...) Expand all Loading... |
| 72 private: | 75 private: |
| 73 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; | 76 base::android::ScopedJavaGlobalRef<jobject> java_info_bar_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); | 78 DISALLOW_COPY_AND_ASSIGN(InfoBarAndroid); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 // Registers the NativeInfoBar's native methods through JNI. | 81 // Registers the NativeInfoBar's native methods through JNI. |
| 79 bool RegisterNativeInfoBar(JNIEnv* env); | 82 bool RegisterNativeInfoBar(JNIEnv* env); |
| 80 | 83 |
| 81 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ | 84 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_INFOBAR_ANDROID_H_ |
| OLD | NEW |