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

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,7 +605,24 @@
if (match.type == AutocompleteMatch::EXTENSION_APP) {
ExtensionAppProvider::LaunchAppFromOmnibox(match, profile_, disposition);
} else {
- controller_->OnAutocompleteAccept(match.destination_url, disposition,
+ GURL destination_url(match.destination_url);
+ if (template_url && match.search_terms_args.get()) {
Peter Kasting 2012/07/31 02:35:01 I think you should add "&& !match.search_terms_arg
hfung 2012/07/31 17:14:45 Done.
+ // Append the query formulation time (time from when the user first typed
Peter Kasting 2012/07/31 02:35:01 Nit: The comment should probably go up above this
hfung 2012/07/31 17:14:45 Done.
+ // a character into the omnibox to when the user selected a query) to the
+ // AQS parameter if other AQS parameters were already populated.
+ base::TimeDelta query_formulation_time =
+ base::TimeTicks::Now() - time_user_first_modified_omnibox_;
+ TemplateURLRef::SearchTermsArgs search_terms_args(
+ *match.search_terms_args);
+ if (!search_terms_args.assisted_query_stats.empty()) {
+ search_terms_args.assisted_query_stats +=
+ base::StringPrintf(".%" PRId64,
+ query_formulation_time.InMilliseconds());
+ }
+ destination_url = GURL(template_url->url_ref().
+ ReplaceSearchTerms(search_terms_args));
+ }
+ controller_->OnAutocompleteAccept(destination_url, disposition,
match.transition, alternate_nav_url);
}
« 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