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

Unified Diff: shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java

Issue 2961203002: Support library changes to allow a callback notifying the selection of default items for Browser Ac… (Closed)
Patch Set: Update based on Yusuf's comments. Created 3 years, 5 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: shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java
diff --git a/shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java b/shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java
index 00af1e2189019aeabbcfcc4d498e22d09a2a073c..361127886a1678ef6ffca834c138ffe681965555 100644
--- a/shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java
+++ b/shared/src/main/java/org/chromium/customtabsclient/shared/CustomTabsHelper.java
@@ -20,6 +20,7 @@ import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
+import android.support.customtabs.CustomTabsClient;
import android.text.TextUtils;
import android.util.Log;
@@ -66,7 +67,7 @@ public class CustomTabsHelper {
PackageManager pm = context.getPackageManager();
// Get default VIEW intent handler.
Intent activityIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com"));
- ResolveInfo defaultViewHandlerInfo = pm.resolveActivity(activityIntent, 0);
+ ResolveInfo defaultViewHandlerInfo = CustomTabsClient.getDefaultHandlerForIntent(pm, activityIntent);
String defaultViewHandlerPackageName = null;
if (defaultViewHandlerInfo != null) {
defaultViewHandlerPackageName = defaultViewHandlerInfo.activityInfo.packageName;

Powered by Google App Engine
This is Rietveld 408576698