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,23 @@ |
if (match.type == AutocompleteMatch::EXTENSION_APP) { |
ExtensionAppProvider::LaunchAppFromOmnibox(match, profile_, disposition); |
} else { |
- controller_->OnAutocompleteAccept(match.destination_url, disposition, |
- match.transition, alternate_nav_url); |
+ if (template_url && match.search_terms_args.get()) { |
+ AutocompleteMatch match_copy(match); |
Peter Kasting
2012/07/30 20:24:02
Nit: You don't need to copy the whole match, just
hfung
2012/07/30 22:47:10
Done.
|
+ base::TimeDelta query_formulation_time = base::TimeTicks::Now() |
Peter Kasting
2012/07/30 20:24:02
Nit: Operators go on the ends of lines; break afte
hfung
2012/07/30 22:47:10
Done.
|
+ - time_user_first_modified_omnibox_; |
+ match_copy.search_terms_args->assisted_query_stats += |
+ base::StringPrintf(".%" PRIuS, |
Peter Kasting
2012/07/30 20:24:02
You've passed the format string for a size_t and t
hfung
2012/07/30 22:47:10
Done.
|
+ query_formulation_time.InMilliseconds()); |
+ match_copy.destination_url = GURL( |
+ template_url->url_ref(). |
+ ReplaceSearchTerms(*match_copy.search_terms_args)); |
+ controller_->OnAutocompleteAccept(match_copy.destination_url, disposition, |
+ match_copy.transition, |
+ alternate_nav_url); |
+ } else { |
+ controller_->OnAutocompleteAccept(match.destination_url, disposition, |
+ match.transition, alternate_nav_url); |
+ } |
} |
if (match.starred) |