Chromium Code Reviews| Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc |
| =================================================================== |
| --- chrome/browser/ui/omnibox/omnibox_edit_model.cc (revision 209999) |
| +++ chrome/browser/ui/omnibox/omnibox_edit_model.cc (working copy) |
| @@ -93,6 +93,10 @@ |
| // in the EnteredKeywordModeMethod enum which is defined in the .h file. |
| const char kEnteredKeywordModeHistogram[] = "Omnibox.EnteredKeywordMode"; |
| +// Histogram name which counts the number of milliseconds a user takes |
| +// between focusing and editing the omnibox. |
| +const char kFocusToEditHistogram[] = "Omnibox.FocusToEdit"; |
| + |
| } // namespace |
| /////////////////////////////////////////////////////////////////////////////// |
| @@ -414,6 +418,9 @@ |
| if (user_input_in_progress_) { |
| time_user_first_modified_omnibox_ = base::TimeTicks::Now(); |
| content::RecordAction(content::UserMetricsAction("OmniboxInputInProgress")); |
| + UMA_HISTOGRAM_COUNTS(kFocusToEditHistogram, |
|
Mark P
2013/07/08 21:58:30
COUNTS is not the right type of histogram for time
H Fung
2013/07/09 01:09:55
I switched to UMA_HISTOGRAM_TIMES but I guess the
|
| + (time_user_first_modified_omnibox_ - |
| + time_user_last_focused_on_omnibox_).InMilliseconds()); |
|
Mark P
2013/07/08 21:58:30
You might want to DCHECK that time_user_last_focus
H Fung
2013/07/09 01:09:55
I do a manual check that the time has been set now
|
| autocomplete_controller()->ResetSession(); |
| } |
| controller_->OnInputInProgress(in_progress); |
| @@ -802,6 +809,8 @@ |
| } |
| void OmniboxEditModel::OnSetFocus(bool control_down) { |
| + time_user_last_focused_on_omnibox_ = base::TimeTicks::Now(); |
| + |
| // If the omnibox lost focus while the caret was hidden and then regained |
| // focus, OnSetFocus() is called and should restore visibility. Note that |
| // focus can be regained without an accompanying call to |