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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java

Issue 2174453002: Don't require FRE for connecting to custom tabs service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java
index 2e931bd08b106797acf681187bdd4c81fc1e0161..d49818ccf1cd4856ae98c9fa2bf0fa005cfe8be8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnectionService.java
@@ -20,12 +20,11 @@ import java.util.List;
*/
public class CustomTabsConnectionService extends CustomTabsService {
private CustomTabsConnection mConnection;
+ private Intent mBindIntent;
@Override
public IBinder onBind(Intent intent) {
- boolean firstRunNecessary = FirstRunFlowSequencer
- .checkIfFirstRunIsNecessary(getApplicationContext(), intent) != null;
- if (firstRunNecessary) return null;
+ mBindIntent = intent;
mConnection = CustomTabsConnection.getInstance(getApplication());
mConnection.logCall("Service#onBind()", true);
return super.onBind(intent);
@@ -40,6 +39,7 @@ public class CustomTabsConnectionService extends CustomTabsService {
@Override
protected boolean warmup(long flags) {
+ if (!isFirstRunDone()) return false;
return mConnection.warmup(flags);
}
@@ -51,6 +51,7 @@ public class CustomTabsConnectionService extends CustomTabsService {
@Override
protected boolean mayLaunchUrl(CustomTabsSessionToken sessionToken, Uri url, Bundle extras,
List<Bundle> otherLikelyBundles) {
+ if (!isFirstRunDone()) return false;
return mConnection.mayLaunchUrl(sessionToken, url, extras, otherLikelyBundles);
}
@@ -61,6 +62,7 @@ public class CustomTabsConnectionService extends CustomTabsService {
@Override
protected boolean updateVisuals(CustomTabsSessionToken sessionToken, Bundle bundle) {
+ if (!isFirstRunDone()) return false;
return mConnection.updateVisuals(sessionToken, bundle);
}
@@ -69,4 +71,15 @@ public class CustomTabsConnectionService extends CustomTabsService {
mConnection.cleanUpSession(sessionToken);
return super.cleanUpSession(sessionToken);
}
+
+ private boolean isFirstRunDone() {
+ if (mBindIntent == null) return true;
+ boolean firstRunNecessary = FirstRunFlowSequencer
+ .checkIfFirstRunIsNecessary(getApplicationContext(), mBindIntent) != null;
+ if (!firstRunNecessary) {
+ mBindIntent = null;
+ return true;
+ }
+ return false;
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698