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

Unified Diff: chrome/browser/search_engines/template_url_service.cc

Issue 10701103: Log a new histogram to track calls to FirstPotentialDefaultEngine. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: use processing_syncer_changes_ 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/search_engines/template_url_service.cc
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc
index dd42b10327546dbe5c157a8dc15e199b5b0bbbdf..1764936d61a50f101344c98ffd8a88e0a337f0e6 100644
--- a/chrome/browser/search_engines/template_url_service.cc
+++ b/chrome/browser/search_engines/template_url_service.cc
@@ -86,6 +86,18 @@ bool TemplateURLsHaveSamePrefs(const TemplateURL* url1,
(url1->input_encodings() == url2->input_encodings());
}
+const char kFirstPotentialEngineHistogramName[] =
+ "Search.FirstPotentialEngineCalled";
+
+// Values for an enumerated histogram used to track whenever
+// FirstPotentialDefaultEngine is called, and from where.
+enum FirstPotentialEngineCaller {
+ FIRST_POTENTIAL_CALLSITE_FIND_NEW_DSP,
+ FIRST_POTENTIAL_CALLSITE_FIND_NEW_DSP_SYNCING,
+ FIRST_POTENTIAL_CALLSITE_ON_LOAD,
+ FIRST_POTENTIAL_CALLSITE_MAX,
+};
+
TemplateURL* FirstPotentialDefaultEngine(
const TemplateURLService::TemplateURLVector& template_urls) {
for (TemplateURLService::TemplateURLVector::const_iterator i(
@@ -599,6 +611,15 @@ TemplateURL* TemplateURLService::FindNewDefaultSearchProvider() {
}
// If not, use the first non-extension keyword of the templates that supports
// search term replacement.
+ if (processing_syncer_changes_) {
+ UMA_HISTOGRAM_ENUMERATION(kFirstPotentialEngineHistogramName,
+ FIRST_POTENTIAL_CALLSITE_FIND_NEW_DSP_SYNCING,
+ FIRST_POTENTIAL_CALLSITE_MAX);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(kFirstPotentialEngineHistogramName,
+ FIRST_POTENTIAL_CALLSITE_FIND_NEW_DSP,
+ FIRST_POTENTIAL_CALLSITE_MAX);
+ }
return FirstPotentialDefaultEngine(template_urls_);
}
@@ -721,6 +742,8 @@ void TemplateURLService::OnWebDataServiceRequestDone(
pending_synced_default_search_ = false;
} else if (database_specified_a_default &&
default_search_provider == NULL) {
+ UMA_HISTOGRAM_ENUMERATION(kFirstPotentialEngineHistogramName,
+ FIRST_POTENTIAL_CALLSITE_ON_LOAD, FIRST_POTENTIAL_CALLSITE_MAX);
default_search_provider = FirstPotentialDefaultEngine(template_urls);
}
« 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