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

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

Issue 9705021: Clean up TemplateURL prepopulate data: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | « chrome/browser/google/google_util.cc ('k') | chrome/browser/search_engines/template_url_prepopulate_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/protector/histograms.cc
===================================================================
--- chrome/browser/protector/histograms.cc (revision 126661)
+++ chrome/browser/protector/histograms.cc (working copy)
@@ -5,7 +5,6 @@
#include "chrome/browser/protector/histograms.h"
#include "base/memory/scoped_ptr.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"
@@ -42,16 +41,10 @@
const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX;
-int GetSearchProviderHistogramID(const TemplateURL* turl) {
- if (!turl || !turl->url())
- return SEARCH_ENGINE_NONE;
- scoped_ptr<TemplateURL> prepopulated_url(
- TemplateURLPrepopulateData::FindPrepopulatedEngine(turl->url()->url()));
- if (prepopulated_url.get())
- return static_cast<int>(prepopulated_url->search_engine_type());
- // If |turl| is not among the prepopulated providers, return
- // SEARCH_ENGINE_OTHER as well.
- return SEARCH_ENGINE_OTHER;
+int GetSearchProviderHistogramID(const TemplateURL* t_url) {
+ return (t_url && t_url->url()) ?
+ TemplateURLPrepopulateData::GetEngineType(t_url->url()->url()) :
+ SEARCH_ENGINE_NONE;
}
} // namespace protector
« no previous file with comments | « chrome/browser/google/google_util.cc ('k') | chrome/browser/search_engines/template_url_prepopulate_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698