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/contextualsearch/ContextualSearchManager.java

Issue 1736203002: [Contextual Search] Add metrics for Resolve and View timing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switched to using a separate timer. Created 4 years, 10 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: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
index 4e18b0d5170ab8d45736dc5cdf62bd3ba0495dda..9fd08ff2187b9500959b0f7a9285c10b9e0a365f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -713,7 +713,7 @@ public class ContextualSearchManager extends ContextualSearchObservable
R.string.contextual_search_error, responseCode);
doLiteralSearch = true;
}
- mSearchPanel.onSearchTermResolutionResponse(message);
+ mSearchPanel.onSearchTermResolved(message);
// If there was an error, fall back onto a literal search for the selection.
// Since we're showing the panel, there must be a selection.
@@ -844,6 +844,13 @@ public class ContextualSearchManager extends ContextualSearchObservable
if (!isExternalUrl) {
// Could be just prefetching, check if that failed.
onContextualSearchRequestNavigation(isFailure);
+
+ // Record metrics for when the prefetched results became viewable.
+ if (mSearchRequest != null && mSearchRequest.wasPrefetch()) {
+ boolean didResolve =
+ mPolicy.shouldPreviousTapResolve(mNetworkCommunicator.getBasePageUrl());
+ mSearchPanel.onPanelNavigatedToPrefetchedSearch(didResolve);
+ }
}
}
@@ -1095,7 +1102,7 @@ public class ContextualSearchManager extends ContextualSearchObservable
&& mSearchPanel.getContentViewCore().getWebContents() != null) {
String url = getContentViewUrl(mSearchPanel.getContentViewCore());
- // If it's a search URL, formats it so the SearchBox becomes visible.
+ // If it's a search URL, format it so the SearchBox becomes visible.
if (mSearchRequest.isContextualSearchUrl(url)) {
url = mSearchRequest.getSearchUrlForPromotion();
}

Powered by Google App Engine
This is Rietveld 408576698