Commit 521d81c3 authored by twellington's avatar twellington Committed by Commit bot

[Contextual Search] Do not log contextual cards data shown if quick action was shown

If a quick action was shown, contextual cards data for a thumbnail/caption
were not shown, so the histograms for whether contextual cards data
was shown should log "false".

BUG=680229

Review-Url: https://codereview.chromium.org/2621413003
Cr-Commit-Position: refs/heads/master@{#443006}
parent 7ee8b4ec
...@@ -696,7 +696,9 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega ...@@ -696,7 +696,9 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
doLiteralSearch = true; doLiteralSearch = true;
} }
boolean receivedContextualCardsData = !TextUtils.isEmpty(caption) boolean quickActionShown =
mSearchPanel.getSearchBarControl().getQuickActionControl().hasQuickAction();
boolean receivedContextualCardsData = !quickActionShown && !TextUtils.isEmpty(caption)
|| !TextUtils.isEmpty(thumbnailUrl); || !TextUtils.isEmpty(thumbnailUrl);
if (ContextualSearchFieldTrial.shouldHideContextualCardsData()) { if (ContextualSearchFieldTrial.shouldHideContextualCardsData()) {
// Clear the thumbnail URL and caption so that they are not displayed in the bar. This // Clear the thumbnail URL and caption so that they are not displayed in the bar. This
...@@ -723,8 +725,6 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega ...@@ -723,8 +725,6 @@ public class ContextualSearchManager implements ContextualSearchManagementDelega
} }
if (ContextualSearchFieldTrial.isContextualSearchSingleActionsEnabled()) { if (ContextualSearchFieldTrial.isContextualSearchSingleActionsEnabled()) {
boolean quickActionShown =
mSearchPanel.getSearchBarControl().getQuickActionControl().hasQuickAction();
ContextualSearchUma.logQuickActionShown(quickActionShown, quickActionCategory); ContextualSearchUma.logQuickActionShown(quickActionShown, quickActionCategory);
mSearchPanel.getPanelMetrics().setWasQuickActionShown(quickActionShown, mSearchPanel.getPanelMetrics().setWasQuickActionShown(quickActionShown,
quickActionCategory); quickActionCategory);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment