OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/protector/histograms.h" | 5 #include "chrome/browser/protector/histograms.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/search_engines/search_engine_type.h" | 8 #include "chrome/browser/search_engines/search_engine_type.h" |
9 #include "chrome/browser/search_engines/template_url.h" | 9 #include "chrome/browser/search_engines/template_url.h" |
10 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 10 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 "Protector.SearchProvider.Fallback"; | 24 "Protector.SearchProvider.Fallback"; |
25 const char kProtectorHistogramSearchProviderHijacked[] = | 25 const char kProtectorHistogramSearchProviderHijacked[] = |
26 "Protector.SearchProvider.Hijacked"; | 26 "Protector.SearchProvider.Hijacked"; |
27 const char kProtectorHistogramSearchProviderMissing[] = | 27 const char kProtectorHistogramSearchProviderMissing[] = |
28 "Protector.SearchProvider.Missing"; | 28 "Protector.SearchProvider.Missing"; |
29 const char kProtectorHistogramSearchProviderRestored[] = | 29 const char kProtectorHistogramSearchProviderRestored[] = |
30 "Protector.SearchProvider.Restored"; | 30 "Protector.SearchProvider.Restored"; |
31 const char kProtectorHistogramSearchProviderTimeout[] = | 31 const char kProtectorHistogramSearchProviderTimeout[] = |
32 "Protector.SearchProvider.Timeout"; | 32 "Protector.SearchProvider.Timeout"; |
33 | 33 |
| 34 const char kProtectorHistogramStartupSettingsApplied[] = |
| 35 "Protector.StartupSettings.Applied"; |
| 36 const char kProtectorHistogramStartupSettingsChanged[] = |
| 37 "Protector.StartupSettings.Changed"; |
| 38 const char kProtectorHistogramStartupSettingsDiscarded[] = |
| 39 "Protector.StartupSettings.Discarded"; |
| 40 const char kProtectorHistogramStartupSettingsTimeout[] = |
| 41 "Protector.StartupSettings.Timeout"; |
| 42 |
34 const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX; | 43 const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX; |
35 | 44 |
36 int GetSearchProviderHistogramID(const TemplateURL* turl) { | 45 int GetSearchProviderHistogramID(const TemplateURL* turl) { |
37 if (!turl || !turl->url()) | 46 if (!turl || !turl->url()) |
38 return SEARCH_ENGINE_NONE; | 47 return SEARCH_ENGINE_NONE; |
39 scoped_ptr<TemplateURL> prepopulated_url( | 48 scoped_ptr<TemplateURL> prepopulated_url( |
40 TemplateURLPrepopulateData::FindPrepopulatedEngine(turl->url()->url())); | 49 TemplateURLPrepopulateData::FindPrepopulatedEngine(turl->url()->url())); |
41 if (prepopulated_url.get()) | 50 if (prepopulated_url.get()) |
42 return static_cast<int>(prepopulated_url->search_engine_type()); | 51 return static_cast<int>(prepopulated_url->search_engine_type()); |
43 // If |turl| is not among the prepopulated providers, return | 52 // If |turl| is not among the prepopulated providers, return |
44 // SEARCH_ENGINE_OTHER as well. | 53 // SEARCH_ENGINE_OTHER as well. |
45 return SEARCH_ENGINE_OTHER; | 54 return SEARCH_ENGINE_OTHER; |
46 } | 55 } |
47 | 56 |
48 } // namespace protector | 57 } // namespace protector |
OLD | NEW |