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

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,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)
« 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