Commit ecc645fc authored by manukh's avatar manukh Committed by Commit Bot

[omnibox] [rich-autocompletion] Add counterfactual logging.

Does not add logging for split rich autocompletion, only title and
non-prefix autocompletion.

Will only trigger if a rich autocompleted suggestion is actually the
default suggestion during a session as otherwise they have no impact.

Bug: 1062446
Change-Id: Idd6f11f94195fdae76a78dde70ec57f8725601ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465804Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarTommy Li <tommycli@chromium.org>
Commit-Queue: manuk hovanesian <manukh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827866}
parent 20a633fc
...@@ -755,6 +755,13 @@ void AutocompleteController::UpdateResult( ...@@ -755,6 +755,13 @@ void AutocompleteController::UpdateResult(
if (notify_default_match) if (notify_default_match)
last_time_default_match_changed_ = base::TimeTicks::Now(); last_time_default_match_changed_ = base::TimeTicks::Now();
if (default_is_valid &&
(result_.default_match()->swapped_fill_into_edit ||
!result_.default_match()->prefix_autocompletion.empty())) {
provider_client_->GetOmniboxTriggeredFeatureService()->TriggerFeature(
OmniboxTriggeredFeatureService::Feature::kRichAutocompletion);
}
NotifyChanged(force_notify_default_match_changed || notify_default_match); NotifyChanged(force_notify_default_match_changed || notify_default_match);
} }
......
...@@ -13,7 +13,12 @@ ...@@ -13,7 +13,12 @@
class OmniboxTriggeredFeatureService { class OmniboxTriggeredFeatureService {
public: public:
// The list of features used for counterfactual slicing. // The list of features used for counterfactual slicing.
enum class Feature {}; // These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class Feature {
kRichAutocompletion = 0,
kMaxValue = kRichAutocompletion,
};
using Features = std::set<Feature>; using Features = std::set<Feature>;
OmniboxTriggeredFeatureService(); OmniboxTriggeredFeatureService();
......
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