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

Unified Diff: chrome/browser/protector/histograms.cc

Issue 8575018: Protector histograms for default search provider change added. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/protector/histograms.cc
diff --git a/chrome/browser/protector/histograms.cc b/chrome/browser/protector/histograms.cc
index d18d0276e8c1309dfa0ab75fcb0a83394519fdda..1f5182dae4a30fee1f5aa62d447a616324db627b 100644
--- a/chrome/browser/protector/histograms.cc
+++ b/chrome/browser/protector/histograms.cc
@@ -4,6 +4,10 @@
#include "chrome/browser/protector/histograms.h"
+#include "chrome/browser/search_engines/search_engine_type.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
+
namespace protector {
const char kProtectorHistogramDefaultSearchProvider[] =
@@ -14,4 +18,27 @@ const char kProtectorBackupInvalidCounter[] =
const char kProtectorValueChangedCounter[] = "Protector.ValueChangedCounter";
const char kProtectorValueValidCounter[] = "Protector.ValueValidCounter";
+const char kProtectorHistogramNewSearchProvider[] =
+ "Protector.NewSearchProvider";
+const char kProtectorHistogramSearchProviderApplied[] =
+ "Protector.SearchProviderApplied";
+const char kProtectorHistogramSearchProviderDiscarded[] =
+ "Protector.SearchProviderDiscarded";
+const char kProtectorHistogramSearchProviderTimeout[] =
+ "Protector.SearchProviderTimeout";
+
+const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX;
+
+int GetSearchProviderHistogramID(const TemplateURL* t_url) {
+ if (t_url && t_url->url()) {
+ TemplateURL* prepopulated =
whywhat 2011/11/21 17:14:57 We need to delete it.
Ivan Korotkov 2011/11/21 17:39:22 Oops.
+ TemplateURLPrepopulateData::FindPrepopulatedEngine(t_url->url()->url());
+ if (prepopulated)
+ return static_cast<int>(prepopulated->search_engine_type());
+ }
+ // If |t_url| is NULL or not among the prepopulated providers, return
+ // SEARCH_ENGINE_OTHER as well.
+ return SEARCH_ENGINE_OTHER;
+}
+
} // namespace protector

Powered by Google App Engine
This is Rietveld 408576698