Index: chrome/browser/android/banners/app_banner_infobar_delegate_android.h |
diff --git a/chrome/browser/android/banners/app_banner_infobar_delegate_android.h b/chrome/browser/android/banners/app_banner_infobar_delegate_android.h |
index c78aa8def8af41f30db46695348dfc8db65437ab..b0fb07b5609450ea57ace8316fa4e4e24dab2506 100644 |
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.h |
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.h |
@@ -11,7 +11,6 @@ |
#include "base/strings/string16.h" |
#include "chrome/browser/banners/app_banner_manager.h" |
#include "components/infobars/core/confirm_infobar_delegate.h" |
-#include "content/public/common/manifest.h" |
#include "ui/gfx/image/image.h" |
#include "url/gurl.h" |
@@ -24,6 +23,7 @@ class InfoBarManager; |
} |
class AppBannerInfoBar; |
+struct ShortcutInfo; |
namespace banners { |
@@ -34,9 +34,7 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
AppBannerInfoBarDelegateAndroid( |
Peter Kasting
2016/09/06 19:31:23
Infobar delegate classes shouldn't have public con
Xi Han
2016/09/07 15:53:17
Done.
|
base::WeakPtr<AppBannerManager> weak_manager, |
const base::string16& app_title, |
- const GURL& manifest_url, |
- const content::Manifest& manifest, |
- const GURL& icon_url, |
+ std::unique_ptr<ShortcutInfo> info, |
Peter Kasting
2016/09/06 19:31:23
Why are you passing and storing this by unique_ptr
Xi Han
2016/09/07 15:53:17
Mostly because it is empty when the delegate is in
Peter Kasting
2016/09/08 04:56:56
That makes sense for now. It seems like this can
|
std::unique_ptr<SkBitmap> icon, |
int event_request_id, |
bool is_webapk); |
@@ -67,6 +65,12 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
const base::android::JavaParamRef<jobject>& obj, |
jboolean success); |
+ // Called when user clicks the "Add To Homescreen" from the app menu to |
+ // install a WebAPK. This function sets the text on infobar to "Adding" and |
+ // disables the button to avoid user interaction. It also starts the WebAPK's |
+ // installation process automatically. |
+ void InstallWebApk(content::WebContents* web_contents); |
+ |
private: |
void CreateJavaDelegate(); |
bool AcceptNativeApp(content::WebContents* web_contents); |
@@ -84,6 +88,7 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
int GetButtons() const override; |
bool Accept() override; |
bool LinkClicked(WindowOpenDisposition disposition) override; |
+ AppBannerInfoBarDelegateAndroid* AsAppBannerInfoBarDelegateAndroid() override; |
base::android::ScopedJavaGlobalRef<jobject> java_delegate_; |
@@ -91,12 +96,10 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate { |
base::WeakPtr<AppBannerManager> weak_manager_; |
base::string16 app_title_; |
- GURL manifest_url_; |
- content::Manifest manifest_; |
+ std::unique_ptr<ShortcutInfo> shortcut_info_; |
base::android::ScopedJavaGlobalRef<jobject> native_app_data_; |
- GURL icon_url_; |
std::unique_ptr<SkBitmap> icon_; |
std::string native_app_package_; |