| 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 GURL& manifest_url, |
| 40 const content::Manifest& manifest); |
| 39 | 41 |
| 40 // Delegate for promoting an Android app. | 42 // Delegate for promoting an Android app. |
| 41 AppBannerInfoBarDelegateAndroid( | 43 AppBannerInfoBarDelegateAndroid( |
| 42 int event_request_id, | 44 int event_request_id, |
| 43 const base::string16& app_title, | 45 const base::string16& app_title, |
| 44 SkBitmap* app_icon, | 46 SkBitmap* app_icon, |
| 45 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, | 47 const base::android::ScopedJavaGlobalRef<jobject>& native_app_data, |
| 46 const std::string& native_app_package, | 48 const std::string& native_app_package, |
| 47 const std::string& referrer); | 49 const std::string& referrer); |
| 48 | 50 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 76 int GetButtons() const override; | 78 int GetButtons() const override; |
| 77 bool Accept() override; | 79 bool Accept() override; |
| 78 bool LinkClicked(WindowOpenDisposition disposition) override; | 80 bool LinkClicked(WindowOpenDisposition disposition) override; |
| 79 | 81 |
| 80 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; | 82 base::android::ScopedJavaGlobalRef<jobject> java_delegate_; |
| 81 | 83 |
| 82 // Used to fetch the splash screen icon for webapps. | 84 // Used to fetch the splash screen icon for webapps. |
| 83 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_; | 85 scoped_refptr<AppBannerDataFetcherAndroid> data_fetcher_; |
| 84 | 86 |
| 85 base::string16 app_title_; | 87 base::string16 app_title_; |
| 88 GURL app_icon_url_; |
| 86 std::unique_ptr<SkBitmap> app_icon_; | 89 std::unique_ptr<SkBitmap> app_icon_; |
| 87 | 90 |
| 88 int event_request_id_; | 91 int event_request_id_; |
| 89 content::Manifest web_app_data_; | 92 GURL manifest_url_; |
| 93 content::Manifest manifest_; |
| 90 | 94 |
| 91 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; | 95 base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
| 92 std::string native_app_package_; | 96 std::string native_app_package_; |
| 93 std::string referrer_; | 97 std::string referrer_; |
| 94 bool has_user_interaction_; | 98 bool has_user_interaction_; |
| 95 | 99 |
| 96 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); | 100 DISALLOW_COPY_AND_ASSIGN(AppBannerInfoBarDelegateAndroid); |
| 97 }; // AppBannerInfoBarDelegateAndroid | 101 }; // AppBannerInfoBarDelegateAndroid |
| 98 | 102 |
| 99 // Register native methods. | 103 // Register native methods. |
| 100 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); | 104 bool RegisterAppBannerInfoBarDelegateAndroid(JNIEnv* env); |
| 101 | 105 |
| 102 } // namespace banners | 106 } // namespace banners |
| 103 | 107 |
| 104 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ | 108 #endif // CHROME_BROWSER_ANDROID_BANNERS_APP_BANNER_INFOBAR_DELEGATE_ANDROID_H_ |
| OLD | NEW |