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_CONFIRM_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_CONFIRM_INFOBAR_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_CONFIRM_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_CONFIRM_INFOBAR_H_ |
7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" |
8 #include "base/macros.h" | 9 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
10 #include "chrome/browser/ui/android/infobars/infobar_android.h" | 11 #include "chrome/browser/ui/android/infobars/infobar_android.h" |
11 #include "components/infobars/core/confirm_infobar_delegate.h" | 12 #include "components/infobars/core/confirm_infobar_delegate.h" |
12 | 13 |
13 class ConfirmInfoBar : public InfoBarAndroid { | 14 class ConfirmInfoBar : public InfoBarAndroid { |
14 public: | 15 public: |
15 explicit ConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate> delegate); | 16 explicit ConfirmInfoBar(std::unique_ptr<ConfirmInfoBarDelegate> delegate); |
16 ~ConfirmInfoBar() override; | 17 ~ConfirmInfoBar() override; |
17 | 18 |
18 protected: | 19 protected: |
19 base::string16 GetTextFor(ConfirmInfoBarDelegate::InfoBarButton button); | 20 base::string16 GetTextFor(ConfirmInfoBarDelegate::InfoBarButton button); |
20 ConfirmInfoBarDelegate* GetDelegate(); | 21 ConfirmInfoBarDelegate* GetDelegate(); |
21 void OnLinkClicked(JNIEnv* env, | 22 void OnLinkClicked(JNIEnv* env, |
22 const base::android::JavaParamRef<jobject>& obj) override; | 23 const base::android::JavaParamRef<jobject>& obj) override; |
23 base::android::ScopedJavaLocalRef<jobject> GetWindowAndroid(); | 24 base::android::ScopedJavaLocalRef<jobject> GetWindowAndroid(); |
24 | 25 |
25 // InfoBarAndroid overrides. | 26 // InfoBarAndroid overrides. |
26 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( | 27 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( |
27 JNIEnv* env) override; | 28 JNIEnv* env) override; |
28 | 29 |
29 private: | |
30 void ProcessButton(int action) override; | 30 void ProcessButton(int action) override; |
31 | 31 |
| 32 private: |
32 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar); | 33 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBar); |
33 }; | 34 }; |
34 | 35 |
35 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_CONFIRM_INFOBAR_H_ | 36 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_CONFIRM_INFOBAR_H_ |
OLD | NEW |