| 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_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace banners { | 27 namespace banners { |
| 28 | 28 |
| 29 // Manages installation of an app being promoted by a webpage. | 29 // Manages installation of an app being promoted by a webpage. |
| 30 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { | 30 class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
| 31 public: | 31 public: |
| 32 // Delegate for promoting a web app. | 32 // Delegate for promoting a web app. |
| 33 AppBannerInfoBarDelegateAndroid( | 33 AppBannerInfoBarDelegateAndroid( |
| 34 int event_request_id, | 34 int event_request_id, |
| 35 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher, | 35 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher, |
| 36 const base::string16& app_title, | 36 const base::string16& app_title, |
| 37 const GURL& app_icon_url, |
| 37 SkBitmap* app_icon, | 38 SkBitmap* app_icon, |
| 38 const content::Manifest& web_app_data); | 39 const content::Manifest& web_app_data); |
| 39 | 40 |
| 40 // Delegate for promoting an Android app. | 41 // Delegate for promoting an Android app. |
| 41 AppBannerInfoBarDelegateAndroid( | 42 AppBannerInfoBarDelegateAndroid( |
| 42 int event_request_id, | 43 int event_request_id, |
| 43 const base::string16& app_title, | 44 const base::string16& app_title, |
| 44 SkBitmap* app_icon, | 45 SkBitmap* app_icon, |
| 45 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, | 46 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, |
| 46 const std::string& native_app_package, | 47 const std::string& native_app_package, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 76 int GetButtons() const override; | 77 int GetButtons() const override; |
| 77 bool Accept() override; | 78 bool Accept() override; |
| 78 bool LinkClicked(WindowOpenDisposition disposition) override; | 79 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 79 | 80 |
| 80 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; | 81 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; |
| 81 | 82 |
| 82 // Used to fetch the splash screen icon for webapps. | 83 // Used to fetch the splash screen icon for webapps. |
| 83 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_; | 84 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_; |
| 84 | 85 |
| 85 base::string16 app_title_; | 86 base::string16 app_title_; |
| 87 GURL app_icon_url_; |
| 86 std::unique_ptr<SkBitmap> app_icon_; | 88 std::unique_ptr<SkBitmap> app_icon_; |
| 87 | 89 |
| 88 int event_request_id_; | 90 int event_request_id_; |
| 89 content::Manifest web_app_data_; | 91 content::Manifest web_app_data_; |
| 90 | 92 |
| 91 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; | 93 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
| 92 std::string native_app_package_; | 94 std::string native_app_package_; |
| 93 std::string referrer_; | 95 std::string referrer_; |
| 94 bool has_user_interaction_; | 96 bool has_user_interaction_; |
| 95 | 97 |
| 96 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); | 98 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); |
| 97 }; // AppBannerInfoBarDelegateAndroid | 99 }; // AppBannerInfoBarDelegateAndroid |
| 98 | 100 |
| 99 // Register native methods. | 101 // Register native methods. |
| 100 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); | 102 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); |
| 101 | 103 |
| 102 } // namespace banners | 104 } // namespace banners |
| 103 | 105 |
| 104 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 106 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| OLD | NEW |