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

Unified Diff: chrome/browser/autocomplete/autocomplete.cc

Issue 7337007: Introduce a field trial for Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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
Index: chrome/browser/autocomplete/autocomplete.cc
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index fff149fb335990e0d2de57655ac9259b17fa751c..57ec4b74ae1bbb5930e0f1d96774222fc715dd35 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -25,6 +25,7 @@
#include "chrome/browser/autocomplete/shortcuts_provider.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
+#include "chrome/browser/instant/instant_field_trial.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -787,7 +788,8 @@ AutocompleteController::AutocompleteController(
AutocompleteControllerDelegate* delegate)
: delegate_(delegate),
done_(true),
- in_start_(false) {
+ in_start_(false),
+ profile_(profile) {
search_provider_ = new SearchProvider(this, profile);
providers_.push_back(search_provider_);
// TODO(mrossetti): Remove the following and permanently modify the
@@ -832,6 +834,7 @@ void AutocompleteController::SetProfile(Profile* profile) {
(*i)->SetProfile(profile);
input_.Clear(); // Ensure we don't try to do a "minimal_changes" query on a
// different profile.
+ profile_ = profile;
}
void AutocompleteController::Start(
@@ -873,7 +876,9 @@ void AutocompleteController::Start(
if (matches_requested == AutocompleteInput::ALL_MATCHES &&
(text.length() < 6)) {
base::TimeTicks end_time = base::TimeTicks::Now();
- std::string name = "Omnibox.QueryTime." + base::IntToString(text.length());
+ std::string name = "Omnibox.QueryTime." +
+ instant_field_trial::GetGroupName(profile_) +
+ base::IntToString(text.length());
base::Histogram* counter = base::Histogram::FactoryGet(
name, 1, 1000, 50, base::Histogram::kUmaTargetedHistogramFlag);
counter->Add(static_cast<int>((end_time - start_time).InMilliseconds()));

Powered by Google App Engine
This is Rietveld 408576698