Revert "Support for measuring page load times."

The page load time measurement was a stop gap measure until server side
support is ready, and we don't want to ship with it in.

Bug: 5266893

This reverts commit b4e831bf1ff62945199b89a77ad039be7bd16545.

Change-Id: Iafc08cea88774e5ecf018112a25e4dc2993a4623
diff --git a/src/com/android/browser/PreloadedTabControl.java b/src/com/android/browser/PreloadedTabControl.java
index b0eff63..4ffe6b4 100644
--- a/src/com/android/browser/PreloadedTabControl.java
+++ b/src/com/android/browser/PreloadedTabControl.java
@@ -15,7 +15,6 @@
  */
 package com.android.browser;
 
-import android.app.PendingIntent;
 import android.net.Uri;
 import android.text.TextUtils;
 import android.util.Log;
@@ -40,7 +39,7 @@
         mTab = t;
     }
 
-    private boolean maybeSetQuery(final String query, SearchBox sb) {
+    private void maybeSetQuery(final String query, SearchBox sb) {
         if (!TextUtils.equals(mLastQuery, query)) {
             if (sb != null) {
                 if (LOGD_ENABLED) Log.d(LOGTAG, "Changing searchbox query to " + query);
@@ -56,27 +55,25 @@
                         }
                     }
                 });
-                return true;
             } else {
                 if (LOGD_ENABLED) Log.d(LOGTAG, "Cannot set query: no searchbox interface");
             }
         }
-        return false;
     }
 
     public void setQuery(String query) {
         maybeSetQuery(query, mTab.getWebView().getSearchBox());
     }
 
-    public boolean searchBoxSubmit(final String query, final String fallbackUrl,
-            final Map<String, String> fallbackHeaders, final PendingIntent onLoadCompleteIntent) {
+    public boolean searchBoxSubmit(final String query,
+            final String fallbackUrl, final Map<String, String> fallbackHeaders) {
         final SearchBox sb = mTab.getWebView().getSearchBox();
         if (sb == null) {
             // no searchbox, cannot submit. Fallback to regular tab creation
             if (LOGD_ENABLED) Log.d(LOGTAG, "No searchbox, cannot submit query");
             return false;
         }
-        final boolean newQuery = maybeSetQuery(query, sb);
+        maybeSetQuery(query, sb);
         if (LOGD_ENABLED) Log.d(LOGTAG, "Submitting query " + query);
         final String currentUrl = mTab.getUrl();
         sb.onsubmit(new SearchBox.SearchBoxListener() {
@@ -87,14 +84,9 @@
                 if (!called) {
                     if (LOGD_ENABLED) Log.d(LOGTAG, "Query not submitted; falling back");
                     loadUrl(fallbackUrl, fallbackHeaders);
-
                     // make sure that the failed, preloaded URL is cleared from the back stack
                     mTab.clearBackStackWhenItemAdded(Pattern.compile(
                             "^" + Pattern.quote(fallbackUrl) + "$"));
-                    // When setting the search box query, preloadAttempted=true implies that the
-                    // the query was prefetched using the searchbox API. This is the case if we
-                    // the query is not new.
-                    registerLoadCompleteListener(!newQuery, false, onLoadCompleteIntent);
                 } else {
                     // ignore the next fragment change, to avoid leaving a blank page in the browser
                     // after the query has been submitted.
@@ -108,27 +100,11 @@
                                     Pattern.quote(currentWithoutFragment) +
                                     "(\\#.*)?" +
                                     "$"));
-                    registerLoadCompleteListener(!newQuery, true, onLoadCompleteIntent);
                 }
             }});
         return true;
     }
 
-    private void registerLoadCompleteListener(
-            final boolean queryPreloaded,
-            final boolean preloadSucceeded,
-            final PendingIntent pendingIntent) {
-        if (pendingIntent == null) {
-            return;
-        }
-        mTab.setOnPageLoadCompleteListener(null, new Tab.OnPageLoadCompleteListener(){
-            @Override
-            public void onPageLoadComplete() {
-                IntentHandler.sendPageLoadCompletePendingIntent(mTab.mContext, pendingIntent,
-                        queryPreloaded, preloadSucceeded);
-            }});
-    }
-
     public void searchBoxCancel() {
         SearchBox sb = mTab.getWebView().getSearchBox();
         if (sb != null) {