Commit e230f2ca authored by Ce Chen's avatar Ce Chen Committed by Commit Bot

Add provider type "ON_DEVICE_HEAD" for on device head suggest.

Result from on device head will be set as [AutocompleteProviderType::TYPE_ON_DEVICE_HEAD|AutocompleteMatchType::SEARCH_SUGGEST|subtype_identifier=271].

Bug: 925072
Change-Id: Iac72e0df2ab03bb331efab68b71a2f9e26f81eee
Reviewed-on: https://chromium-review.googlesource.com/c/1484502
Commit-Queue: Ce Chen <cch@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635799}
parent 80a997a0
......@@ -64,16 +64,24 @@ void AutocompleteMatchToAssistedQuery(
// Default value, indicating no subtype.
*subtype = base::string16::npos;
// If provider is TYPE_ZERO_SUGGEST, set the subtype accordingly.
// Type will be set in the switch statement below where we'll enter one of
// SEARCH_SUGGEST or NAVSUGGEST. This subtype indicates context-aware zero
// suggest.
if (provider &&
(provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST) &&
(match != AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED)) {
DCHECK((match == AutocompleteMatchType::SEARCH_SUGGEST) ||
(match == AutocompleteMatchType::NAVSUGGEST));
*subtype = 66;
// If provider is TYPE_ZERO_SUGGEST or TYPE_ON_DEVICE_HEAD, set the subtype
// accordingly. Type will be set in the switch statement below where we'll
// enter one of SEARCH_SUGGEST or NAVSUGGEST.
if (provider) {
if (provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST &&
(match != AutocompleteMatchType::SEARCH_SUGGEST_PERSONALIZED)) {
DCHECK((match == AutocompleteMatchType::SEARCH_SUGGEST) ||
(match == AutocompleteMatchType::NAVSUGGEST));
// We abuse this subtype and use it to for zero-suggest suggestions that
// aren't personalized by the server. That is, it indicates either
// client-side most-likely URL suggestions or server-side suggestions
// that depend only on the URL as context.
*subtype = 66;
} else if (provider->type() == AutocompleteProvider::TYPE_ON_DEVICE_HEAD) {
DCHECK(match == AutocompleteMatchType::SEARCH_SUGGEST);
// This subtype indicates a match from an on-device head provider.
*subtype = 271;
}
}
switch (match) {
......
......@@ -53,6 +53,8 @@ const char* AutocompleteProvider::TypeToString(Type type) {
return "ZeroSuggest";
case TYPE_CLIPBOARD:
return "Clipboard";
case TYPE_ON_DEVICE_HEAD:
return "OnDeviceHead";
default:
NOTREACHED() << "Unhandled AutocompleteProvider::Type " << type;
return "Unknown";
......
......@@ -64,6 +64,7 @@ typedef std::vector<metrics::OmniboxEventProto_ProviderInfo> ProvidersInfo;
// Search Secondary Provider (past query in history) | 200*
// Search Secondary Provider (navigational suggestion) | 150++
// Search Secondary Provider (suggestion) | 100++
// Non Personalized On Device Head Suggest Provider | 99--
// Document Suggestions (*experimental): value controlled by Finch | *
//
// URL input type:
......@@ -102,6 +103,7 @@ typedef std::vector<metrics::OmniboxEventProto_ProviderInfo> ProvidersInfo;
// Search Secondary Provider (past query in history) | 200*
// Search Secondary Provider (navigational suggestion) | 150++
// Search Secondary Provider (suggestion) | 100++
// Non Personalized On Device Head Suggest Provider | 99--
//
// (A search keyword is a keyword with a replacement string; a bookmark keyword
// is a keyword with no replacement string, that is, a shortcut for a URL.)
......@@ -142,6 +144,7 @@ class AutocompleteProvider
TYPE_ZERO_SUGGEST = 1 << 7,
TYPE_CLIPBOARD = 1 << 8,
TYPE_DOCUMENT = 1 << 9,
TYPE_ON_DEVICE_HEAD = 1 << 10,
};
explicit AutocompleteProvider(Type type);
......
Name: Metrics Protos
Short Name: metrics_proto
URL: This is the canonical public repository
Version: 234842562
Date: 2019/02/20 UTC
Version: 235268166
Date: 2019/02/22 UTC
License: BSD
Security Critical: Yes
......
......@@ -197,6 +197,9 @@ message OmniboxEventProto {
PHYSICAL_WEB = 15; // DEPRECATED. Suggestions triggered by URLs broadcast
// by nearby devices.
DOCUMENT = 16; // Suggestions for documents in a cloud corpus.
// Non personalized query suggestions generated from a lightweight on device
// head model.
ON_DEVICE_HEAD = 17;
}
// The result set displayed on the completion popup
......
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