| Index: chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| index a8df5211de0d040a2abf091b6cd20d2de820fde3..cea82fde8e9994c7cd2957611a9f061d29bd18f3 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java
|
| @@ -69,6 +69,8 @@ import java.util.concurrent.atomic.AtomicReference;
|
| public class CustomTabsConnection {
|
| private static final String TAG = "ChromeConnection";
|
| private static final String LOG_SERVICE_REQUESTS = "custom-tabs-log-service-requests";
|
| + public static final int PAGE_LOAD_METRIC = 42;
|
| +
|
| @VisibleForTesting
|
| static final String NO_PRERENDERING_KEY =
|
| "android.support.customtabs.maylaunchurl.NO_PRERENDERING";
|
| @@ -552,6 +554,30 @@ public class CustomTabsConnection {
|
| }
|
|
|
| /**
|
| + * Notifies the application of a page load metric.
|
| + *
|
| + * TODD(lizeb): Move this to a proper method in {@link CustomTabsCallback} once one is
|
| + * available.
|
| + *
|
| + * @param session Session identifier.
|
| + * @param metricName Name of the page load metric.
|
| + * @param offsetMs Offset in ms from navigationStart.
|
| + */
|
| + boolean notifyPageLoadMetric(CustomTabsSessionToken session, String metricName, long offsetMs) {
|
| + CustomTabsCallback callback = mClientManager.getCallbackForSession(session);
|
| + if (callback == null) return false;
|
| + Bundle args = new Bundle();
|
| + args.putLong(metricName, offsetMs);
|
| + try {
|
| + callback.onNavigationEvent(PAGE_LOAD_METRIC, args);
|
| + } catch (Exception e) {
|
| + // Pokemon exception handling, see above and crbug.com/517023.
|
| + return false;
|
| + }
|
| + return true;
|
| + }
|
| +
|
| + /**
|
| * Keeps the application linked with a given session alive.
|
| *
|
| * The application is kept alive (that is, raised to at least the current
|
|
|