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

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

Issue 10829068: Add query formulation time to aqs (assisted query stats) parameter (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 5 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: 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)
« 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