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

Unified Diff: chrome/browser/ui/omnibox/omnibox_edit_model.cc

Issue 11316057: Omnibox: Log Elapsed Time Since Last Time The Default Match Changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback comments. Created 8 years, 1 month 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
Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_edit_model.cc b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
index 188611d51c8d59bf58b73013b81d2d9bb9549725..76d5c3a68582afa17bad173a610046ad472fcf07 100644
--- a/chrome/browser/ui/omnibox/omnibox_edit_model.cc
+++ b/chrome/browser/ui/omnibox/omnibox_edit_model.cc
@@ -541,6 +541,7 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
// We only care about cases where there is a selection (i.e. the popup is
// open).
if (popup_->IsOpen()) {
+ const base::TimeTicks& now(base::TimeTicks::Now());
// TODO(sreeram): Handle is_temporary_text_set_by_instant_ correctly.
AutocompleteLog log(
autocomplete_controller_->input().text(),
@@ -550,14 +551,20 @@ void OmniboxEditModel::OpenMatch(const AutocompleteMatch& match,
-1, // don't yet know tab ID; set later if appropriate
ClassifyPage(controller_->GetTabContents()->
web_contents()->GetURL()),
- base::TimeTicks::Now() - time_user_first_modified_omnibox_,
+ now - time_user_first_modified_omnibox_,
string16::npos, // inline autocomplete length; possibly set later
+ now - autocomplete_controller_->last_time_default_match_changed(),
result());
DCHECK(user_input_in_progress_ ||
match.provider->type() == AutocompleteProvider::TYPE_ZERO_SUGGEST)
<< "We didn't get here through the expected series of calls. "
<< "time_user_first_modified_omnibox_ is not set correctly and other "
<< "things may be wrong. Match provider: " << match.provider->GetName();
+ DCHECK(log.elapsed_time_since_user_first_modified_omnibox >=
+ log.elapsed_time_since_last_change_to_default_match)
+ << "We should've got the notification that the user modified the "
+ << "omnibox text at same time or before the most recent time the "
+ << "default match changed.";
if (index != OmniboxPopupModel::kNoMatch)
log.selected_index = index;
else if (!has_temporary_text_)

Powered by Google App Engine
This is Rietveld 408576698