Index: chrome/browser/ui/omnibox/omnibox_edit_model.cc |
=================================================================== |
--- chrome/browser/ui/omnibox/omnibox_edit_model.cc (revision 148850) |
+++ chrome/browser/ui/omnibox/omnibox_edit_model.cc (working copy) |
@@ -6,8 +6,10 @@ |
#include <string> |
+#include "base/format_macros.h" |
#include "base/metrics/histogram.h" |
#include "base/string_util.h" |
+#include "base/stringprintf.h" |
#include "base/utf_string_conversions.h" |
#include "chrome/app/chrome_command_ids.h" |
#include "chrome/browser/autocomplete/autocomplete_classifier.h" |
@@ -603,8 +605,21 @@ |
if (match.type == AutocompleteMatch::EXTENSION_APP) { |
ExtensionAppProvider::LaunchAppFromOmnibox(match, profile_, disposition); |
} else { |
- controller_->OnAutocompleteAccept(match.destination_url, disposition, |
- match.transition, alternate_nav_url); |
+ GURL destination_url(match.destination_url); |
+ if (template_url && match.search_terms_args.get()) { |
Peter Kasting
2012/07/30 22:52:50
Nit: Comments about what you're doing?
hfung
2012/07/31 01:06:47
Done.
|
+ base::TimeDelta query_formulation_time = |
+ base::TimeTicks::Now() - time_user_first_modified_omnibox_; |
+ TemplateURLRef::SearchTermsArgs search_terms_args( |
+ *match.search_terms_args.get()); |
Peter Kasting
2012/07/30 22:52:50
Nit: No need for get()
hfung
2012/07/31 01:06:47
Done.
|
+ search_terms_args.assisted_query_stats += |
Peter Kasting
2012/07/30 22:52:50
You unconditionally add to this. That seems quest
hfung
2012/07/31 01:06:47
I'm not sure since it seems to always be set in Au
|
+ base::StringPrintf(".%" WidePRIu64, |
Peter Kasting
2012/07/30 22:52:50
Why is this using the wide format arg when the str
hfung
2012/07/31 01:06:47
Done. Sorry, I didn't read format_macros.h carefu
|
+ query_formulation_time.InMilliseconds()); |
+ destination_url = GURL(template_url->url_ref(). |
+ ReplaceSearchTerms(search_terms_args)); |
+ } |
+ controller_->OnAutocompleteAccept(destination_url, disposition, |
+ match.transition, |
Peter Kasting
2012/07/30 22:52:50
Nit: Why add a linebreak?
hfung
2012/07/31 01:06:47
Done.
|
+ alternate_nav_url); |
} |
if (match.starred) |