Commit 7909e4c4 authored by Donn Denman's avatar Donn Denman Committed by Commit Bot

[TTS] Add server-debug, exact-search mixin codes.

Converts the server-debug setting used for CoCa integration debugging
from a single value to a mixin so we can include that at any level
of integration.

Also adds support for the exact-search bit as a CoCa integration
mixin due to lack of support for the additional parameter needed
to support this critical feature correctly.

The need for this is covered in issue 1060669.

BUG=1060669, 1059004, 956277, 985518

Change-Id: I53d5a9acf114e1b84f8821ddf05283eabcd1c30f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098489
Auto-Submit: Donn Denman <donnd@chromium.org>
Commit-Queue: Theresa  <twellington@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749355}
parent de9574ce
...@@ -285,11 +285,18 @@ std::string ContextualSearchDelegate::BuildRequestUrl( ...@@ -285,11 +285,18 @@ std::string ContextualSearchDelegate::BuildRequestUrl(
contextual_cards_version = contextual_cards_version =
contextual_search::kContextualCardsTranslationsIntegration; contextual_search::kContextualCardsTranslationsIntegration;
} }
// TODO(donnd): figure out if this is really needed or if the communication // Mixin the debug setting.
// can be done automatically through a FieldTrial config setting.
if (base::FeatureList::IsEnabled(chrome::android::kContextualSearchDebug)) { if (base::FeatureList::IsEnabled(chrome::android::kContextualSearchDebug)) {
contextual_cards_version = contextual_cards_version +=
contextual_search::kContextualCardsDebugIntegration; contextual_search::kContextualCardsServerDebugMixin;
}
// Mixin the exact-search setting.
// TODO(donnd): remove or merge-away this ugly implementation if we get
// approval for the additional parameter used below (in
// ContextualSearchParams). It would be better to only have to support
// one of these communication methods server-side.
if (context->GetExactResolve()) {
contextual_cards_version += contextual_search::kExactSearchMixin;
} }
// Let the field-trial override. // Let the field-trial override.
if (field_trial_->GetContextualCardsVersion() != 0) { if (field_trial_->GetContextualCardsVersion() != 0) {
......
...@@ -23,7 +23,11 @@ const int kContextualCardsDefinitionsIntegration = 4; ...@@ -23,7 +23,11 @@ const int kContextualCardsDefinitionsIntegration = 4;
const int kContextualCardsTranslationsIntegration = 5; const int kContextualCardsTranslationsIntegration = 5;
// For development. // For development.
const int kContextualCardsDebugIntegration = 98;
const int kContextualCardsDiagnosticIntegration = 99; const int kContextualCardsDiagnosticIntegration = 99;
// Mixin values. These are a bit mask * 100:
const int kSimplifiedServerDeprecatedMixin = 100;
const int kContextualCardsServerDebugMixin = 200;
const int kExactSearchMixin = 400;
} // namespace contextual_search } // namespace contextual_search
...@@ -30,12 +30,20 @@ extern const int kContextualCardsTranslationsIntegration; ...@@ -30,12 +30,20 @@ extern const int kContextualCardsTranslationsIntegration;
// Development-level CoCa integration codes. // Development-level CoCa integration codes.
// For both client and server-side debugging.
extern const int kContextualCardsDebugIntegration;
// Generates diagnostics on the client and uses the ENTRYPOINT_UNSPECIFIED for // Generates diagnostics on the client and uses the ENTRYPOINT_UNSPECIFIED for
// CoCa to return unlimited cards with diagnostics enabled. // CoCa to return unlimited cards with diagnostics enabled.
extern const int kContextualCardsDiagnosticIntegration; extern const int kContextualCardsDiagnosticIntegration;
// Mixin values. You must choose only one of the above, but any combination
// of these mixin values.
// Deprecated value that might be sent by an old client.
extern const int kSimplifiedServerDeprecatedMixin;
// Activates server-side debugging.
extern const int kContextualCardsServerDebugMixin;
// Indicates that the current request is for an exact search.
extern const int kExactSearchMixin;
// Longpress resolve variations: // Longpress resolve variations:
extern const char kLongpressResolveParamName[]; extern const char kLongpressResolveParamName[];
extern const char kLongpressResolvePreserveTap[]; extern const char kLongpressResolvePreserveTap[];
......
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