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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java

Issue 2322793002: [Contextual Search] Fetch and display thumbnails returned in resolution response (Closed)
Patch Set: std::unique_ptr Created 4 years, 3 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 4ba551228cff3f001a6e808f728b4208a1ecc914..afb131757b8bfc19d03061024a1e9c04627595c0 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
@@ -480,8 +480,7 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
// Note: whether the sprite should be animated or not needs to be set before the call to
// peekPanel(). If the sprite should be animated, the animation will begin after the panel
// finishes peeking. If it should not be animated, the icon will be drawn right away.
- mSearchPanel.setShouldAnimateIconSprite(mPolicy.shouldAnimateSearchProviderIcon(),
- ContextualSearchFieldTrial.areExtraSearchBarAnimationsDisabled());
+ mSearchPanel.setShouldAnimateIconSprite(mPolicy.shouldAnimateSearchProviderIcon());
// Note: now that the contextual search has properly started, set the promo involvement.
if (mPolicy.isPromoAvailable()) {
@@ -653,22 +652,23 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
* @param selectionEndAdjust A positive number of characters that the end of the existing
* selection should be expanded by.
* @param contextLanguage The language of the original search term, or an empty string.
+ * @param thumbnailUrl The URL of the thumbnail to display in our UX.
*/
@CalledByNative
public void onSearchTermResolutionResponse(boolean isNetworkUnavailable, int responseCode,
final String searchTerm, final String displayText, final String alternateTerm,
final String mid, boolean doPreventPreload, int selectionStartAdjust,
- int selectionEndAdjust, final String contextLanguage) {
+ int selectionEndAdjust, final String contextLanguage, final String thumbnailUrl) {
mNetworkCommunicator.handleSearchTermResolutionResponse(isNetworkUnavailable, responseCode,
searchTerm, displayText, alternateTerm, mid, doPreventPreload, selectionStartAdjust,
- selectionEndAdjust, contextLanguage);
+ selectionEndAdjust, contextLanguage, thumbnailUrl);
}
@Override
public void handleSearchTermResolutionResponse(boolean isNetworkUnavailable, int responseCode,
String searchTerm, String displayText, String alternateTerm, String mid,
boolean doPreventPreload, int selectionStartAdjust, int selectionEndAdjust,
- String contextLanguage) {
+ String contextLanguage, String thumbnailUrl) {
// Show an appropriate message for what to search for.
String message;
boolean doLiteralSearch = false;
@@ -686,7 +686,9 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
R.string.contextual_search_error, responseCode);
doLiteralSearch = true;
}
- mSearchPanel.onSearchTermResolved(message);
+ thumbnailUrl = ContextualSearchFieldTrial.isNowOnTapBarIntegrationEnabled()
+ ? thumbnailUrl : "";
+ mSearchPanel.onSearchTermResolved(message, thumbnailUrl);
// 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.

Powered by Google App Engine
This is Rietveld 408576698