Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: chrome/browser/android/banners/app_banner_infobar_delegate_android.h

Issue 2290603005: Trigger app banner when add to homescreen is pressed and WebAPKs are enabled. (Closed)
Patch Set: dominickn@ and dfalcantara@'s comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..886bb122b80c74d3a3617e2cb750de9a0b9374e9 100644
--- a/chrome/browser/android/banners/app_banner_infobar_delegate_android.h
+++ b/chrome/browser/android/banners/app_banner_infobar_delegate_android.h
@@ -24,6 +24,7 @@ class InfoBarManager;
}
class AppBannerInfoBar;
+struct ShortcutInfo;
namespace banners {
@@ -35,6 +36,17 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
base::WeakPtr<AppBannerManager> weak_manager,
const base::string16& app_title,
const GURL& manifest_url,
+ std::unique_ptr<ShortcutInfo> info,
+ const GURL& icon_url,
+ std::unique_ptr<SkBitmap> icon,
+ int event_request_id,
+ bool is_webapk);
+
+ // Delegate for promoting a web app.
+ AppBannerInfoBarDelegateAndroid(
+ 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<SkBitmap> icon,
@@ -67,6 +79,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 +102,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_;
@@ -92,7 +111,7 @@ class AppBannerInfoBarDelegateAndroid : public ConfirmInfoBarDelegate {
base::string16 app_title_;
GURL manifest_url_;
- content::Manifest manifest_;
+ std::unique_ptr<ShortcutInfo> shortcut_info_;
base::android::ScopedJavaGlobalRef<jobject> native_app_data_;

Powered by Google App Engine
This is Rietveld 408576698