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

Unified Diff: components/omnibox/browser/omnibox_edit_model.cc

Issue 2295043005: Skip omnibox default match update check when input is from omnibox focus (Closed)
Patch Set: revise comment 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/omnibox_edit_model.cc
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
index 88067e45245a263fb96c340054a2f3c819e6ed0d..26c908a942ecbf92262936b53d0205a59e6fa931 100644
--- a/components/omnibox/browser/omnibox_edit_model.cc
+++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -664,15 +664,14 @@ void OmniboxEditModel::OpenMatch(AutocompleteMatch match,
base::TimeDelta elapsed_time_since_last_change_to_default_match(
now - autocomplete_controller()->last_time_default_match_changed());
DCHECK(match.provider);
- // These elapsed times don't really make sense for ZeroSuggest matches
- // (because the user does not modify the omnibox for ZeroSuggest), so for
- // those we set the elapsed times to something that will be ignored by
+ // These elapsed times don't really make sense for matches that come from
+ // omnibox focus (because the user did not modify the omnibox), so for those
+ // we set the elapsed times to something that will be ignored by
// metrics_log.cc. They also don't necessarily make sense if the omnibox
// dropdown is closed or the user used a paste-and-go action. (In most
// cases when this happens, the user never modified the omnibox.)
const bool popup_open = PopupIsOpen();
- if ((match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST) ||
- !popup_open || !pasted_text.empty()) {
+ if (input_.from_omnibox_focus() || !popup_open || !pasted_text.empty()) {
const base::TimeDelta default_time_delta =
base::TimeDelta::FromMilliseconds(-1);
elapsed_time_since_user_first_modified_omnibox = default_time_delta;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698