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

Unified Diff: tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java

Issue 2403023002: customtabs: Add a flag to mayLaunchUrl() to force prefetch. (Closed)
Patch Set: Accidentally a chunk. 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: tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
diff --git a/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java b/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
index 807eb335f85c8dabf198749a67fc7027794c0774..00d0cd7c219771b3fdc19e3167d8f6debdc1e29d 100644
--- a/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
+++ b/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
@@ -26,6 +26,12 @@ public class MainActivity extends Activity {
private static final String DEFAULT_URL = "https://www.android.com";
private static final String DEFAULT_PACKAGE = "com.google.android.apps.chrome";
+ // Keep in sync with the same constants in CustomTabsConnection.
+ private static final String DEBUG_OVERRIDE_KEY =
+ "android.support.customtabs.maylaunchurl.DEBUG_OVERRIDE";
+ private static final int NO_PRERENDERING = 1;
+ private static final int PREFETCH_ONLY = 2;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -144,9 +150,7 @@ public class MainActivity extends Activity {
@Override
public void run() {
Bundle extras = new Bundle();
- extras.putBoolean(
- "android.support.customtabs.maylaunchurl.NO_PRERENDERING",
- prerenderMode == 0);
+ if (prerenderMode == 0) extras.putInt(DEBUG_OVERRIDE_KEY, NO_PRERENDERING);
session.mayLaunchUrl(uri, extras, null);
handler.postDelayed(launchRunnable, delayToLaunchUrl);
}

Powered by Google App Engine
This is Rietveld 408576698