| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "components/infobars/core/confirm_infobar_delegate.h" | 10 #include "components/infobars/core/confirm_infobar_delegate.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // returned to Chrome. | 49 // returned to Chrome. |
| 50 void OnInstallIntentReturned(JNIEnv* env, | 50 void OnInstallIntentReturned(JNIEnv* env, |
| 51 jobject obj, | 51 jobject obj, |
| 52 jboolean jis_installing); | 52 jboolean jis_installing); |
| 53 | 53 |
| 54 // Called when the InstallerDelegate task has finished. | 54 // Called when the InstallerDelegate task has finished. |
| 55 void OnInstallFinished(JNIEnv* env, | 55 void OnInstallFinished(JNIEnv* env, |
| 56 jobject obj, | 56 jobject obj, |
| 57 jboolean success); | 57 jboolean success); |
| 58 | 58 |
| 59 // InfoBarDelegate overrides. | |
| 60 gfx::Image GetIcon() const override; | |
| 61 void InfoBarDismissed() override; | |
| 62 | |
| 63 // ConfirmInfoBarDelegate overrides. | |
| 64 base::string16 GetMessageText() const override; | |
| 65 int GetButtons() const override; | |
| 66 bool Accept() override; | |
| 67 bool LinkClicked(WindowOpenDisposition disposition) override; | |
| 68 | |
| 69 private: | 59 private: |
| 70 AppBannerInfoBarDelegate( | 60 AppBannerInfoBarDelegate( |
| 71 const base::string16& app_title, | 61 const base::string16& app_title, |
| 72 SkBitmap* app_icon, | 62 SkBitmap* app_icon, |
| 73 const content::Manifest& web_app_data, | 63 const content::Manifest& web_app_data, |
| 74 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, | 64 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, |
| 75 const std::string& native_app_package); | 65 const std::string& native_app_package); |
| 76 | 66 |
| 67 // ConfirmInfoBarDelegate: |
| 68 gfx::Image GetIcon() const override; |
| 69 void InfoBarDismissed() override; |
| 70 base::string16 GetMessageText() const override; |
| 71 int GetButtons() const override; |
| 72 bool Accept() override; |
| 73 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 74 |
| 77 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; | 75 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; |
| 78 | 76 |
| 79 base::string16 app_title_; | 77 base::string16 app_title_; |
| 80 scoped_ptr<SkBitmap> app_icon_; | 78 scoped_ptr<SkBitmap> app_icon_; |
| 81 | 79 |
| 82 content::Manifest web_app_data_; | 80 content::Manifest web_app_data_; |
| 83 | 81 |
| 84 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; | 82 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
| 85 std::string native_app_package_; | 83 std::string native_app_package_; |
| 86 | 84 |
| 87 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); | 85 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegate); |
| 88 }; // AppBannerInfoBarDelegate | 86 }; // AppBannerInfoBarDelegate |
| 89 | 87 |
| 90 // Register native methods. | 88 // Register native methods. |
| 91 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env); | 89 bool RegisterAppBannerInfoBarDelegate(JNIEnv* env); |
| 92 | 90 |
| 93 } // namespace banners | 91 } // namespace banners |
| 94 | 92 |
| 95 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ | 93 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_H_ |
| OLD | NEW |