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

Unified Diff: demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java

Issue 1603383003: color, package and action bar configuration. (Closed) Base URL: https://github.com/GoogleChrome/custom-tabs-client.git@master
Patch Set: fixes Created 4 years, 9 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: demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java
diff --git a/demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java b/demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java
index 3a6175dfcb855a0e4a230a7c3564ee42ced73e19..151b0abaad3fbaaa01abfd9655cbdb3364773daa 100644
--- a/demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java
+++ b/demos/src/main/java/org/chromium/customtabsdemos/CustomTabActivityHelper.java
@@ -52,13 +52,22 @@ public class CustomTabActivityHelper implements ServiceConnectionCallback {
CustomTabsIntent customTabsIntent,
Uri uri,
CustomTabFallback fallback) {
- String packageName = CustomTabsHelper.getPackageNameToUse(activity);
+ openCustomTab(activity, customTabsIntent, uri, fallback, null);
+ }
- //If we cant find a package name, it means theres no browser that supports
- //Chrome Custom Tabs installed. So, we fallback to the webview
+ public static void openCustomTab(Activity activity,
+ CustomTabsIntent customTabsIntent,
Ian Wen 2016/03/16 01:35:30 Public methods should have javadocs
BigBossZhiling 2016/03/18 00:59:07 Done.
+ Uri uri,
+ CustomTabFallback fallback,
+ String packageName) {
if (packageName == null) {
- if (fallback != null) {
- fallback.openUri(activity, uri);
+ packageName = CustomTabsHelper.getPackageNameToUse(activity);
+ //If we cant find a package name, it means theres no browser that supports
+ //Chrome Custom Tabs installed. So, we fallback to the webview
+ if (packageName == null) {
+ if (fallback != null) {
+ fallback.openUri(activity, uri);
+ }
}
} else {
customTabsIntent.intent.setPackage(packageName);

Powered by Google App Engine
This is Rietveld 408576698