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 |