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

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

Issue 2379783002: Instant App Banner logic. (Closed)
Patch Set: Fixing tests. Created 4 years, 2 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/InstantAppsInfoBarDelegate.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InstantAppsInfoBarDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InstantAppsInfoBarDelegate.java
index 39284302771798f0a9299540720e2adbdce82288..e84faf4efa598ba78a61f6f88e118272edb11643 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/InstantAppsInfoBarDelegate.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/InstantAppsInfoBarDelegate.java
@@ -4,13 +4,6 @@
package org.chromium.chrome.browser.infobar;
-import android.content.ActivityNotFoundException;
-import android.content.Context;
-import android.content.Intent;
-import android.graphics.Bitmap;
-
-import org.chromium.base.ContextUtils;
-import org.chromium.base.Log;
import org.chromium.base.annotations.CalledByNative;
import org.chromium.chrome.browser.instantapps.InstantAppsBannerData;
import org.chromium.chrome.browser.instantapps.InstantAppsHandler;
@@ -24,10 +17,8 @@ public class InstantAppsInfoBarDelegate {
private InstantAppsBannerData mData;
- public static void launch(WebContents webContents, String url, String label, Bitmap icon,
- Intent intent) {
- InstantAppsBannerData appsBannerData = new InstantAppsBannerData(label, icon, url, intent);
- nativeLaunch(webContents, appsBannerData);
+ public static void launch(InstantAppsBannerData data) {
+ nativeLaunch(data.getWebContents(), data, data.getUrl());
}
@CalledByNative
@@ -39,14 +30,9 @@ public class InstantAppsInfoBarDelegate {
@CalledByNative
private void openInstantApp(InstantAppsBannerData data) {
- Context appContext = ContextUtils.getApplicationContext();
- try {
- appContext.startActivity(data.getIntent());
- } catch (ActivityNotFoundException e) {
- Log.e(TAG, "No activity found to launch intent " + data.getIntent(), e);
- }
- InstantAppsHandler.getInstance().recordDefaultOpen(data.getUrl());
+ InstantAppsHandler.getInstance().launchFromBanner(data);
}
- private static native void nativeLaunch(WebContents webContents, InstantAppsBannerData data);
+ private static native void nativeLaunch(WebContents webContents, InstantAppsBannerData data,
+ String url);
}

Powered by Google App Engine
This is Rietveld 408576698