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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java

Issue 2259553002: Make AppBannerInfoBar install WebAPK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 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/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java
index 0ffe9f04c3fcc337da71feffc4d81aba76408a24..35778b5eaf9475a02b2d8e95941ce14eac444769 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java
@@ -26,6 +26,8 @@ public class AppBannerInfoBarAndroid extends ConfirmInfoBar implements View.OnCl
public static final int INSTALL_STATE_NOT_INSTALLED = 0;
public static final int INSTALL_STATE_INSTALLING = 1;
public static final int INSTALL_STATE_INSTALLED = 2;
+ public static final int INSTALL_STATE_INSTALLING_WEBAPK = 3;
+ public static final int INSTALL_STATE_INSTALLED_WEBAPK = 4;
pkotwicz 2016/08/19 22:17:37 Can we pass in whether the infobar is for a WebAPK
// Views composing the infobar.
private Button mButton;
@@ -136,7 +138,11 @@ public class AppBannerInfoBarAndroid extends ConfirmInfoBar implements View.OnCl
}
private void updateButton() {
- if (mButton == null || mAppData == null) return;
+ if (mButton == null || mAppData == null
+ && (mInstallState != INSTALL_STATE_INSTALLING_WEBAPK
+ && mInstallState != INSTALL_STATE_INSTALLED_WEBAPK)) {
+ return;
+ }
String text;
String accessibilityText = null;
@@ -148,6 +154,9 @@ public class AppBannerInfoBarAndroid extends ConfirmInfoBar implements View.OnCl
} else if (mInstallState == INSTALL_STATE_INSTALLING) {
text = getContext().getString(R.string.app_banner_installing);
enabled = false;
+ } else if (mInstallState == INSTALL_STATE_INSTALLING_WEBAPK) {
+ text = getContext().getString(R.string.app_banner_installing_webapk);
+ enabled = false;
} else {
text = getContext().getString(R.string.app_banner_open);
}

Powered by Google App Engine
This is Rietveld 408576698