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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
9 #include "chrome/browser/search_engines/template_url.h" 8 #include "chrome/browser/search_engines/template_url.h"
10 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" 9 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
11 10
12 namespace protector { 11 namespace protector {
13 12
14 const char kProtectorHistogramDefaultSearchProvider[] = 13 const char kProtectorHistogramDefaultSearchProvider[] =
15 "Protector.DefaultSearchProvider"; 14 "Protector.DefaultSearchProvider";
16 15
17 const char kProtectorHistogramSearchProviderApplied[] = 16 const char kProtectorHistogramSearchProviderApplied[] =
18 "Protector.SearchProvider.Applied"; 17 "Protector.SearchProvider.Applied";
(...skipping 16 matching lines...) Expand all
35 "Protector.StartupSettings.Applied"; 34 "Protector.StartupSettings.Applied";
36 const char kProtectorHistogramStartupSettingsChanged[] = 35 const char kProtectorHistogramStartupSettingsChanged[] =
37 "Protector.StartupSettings.Changed"; 36 "Protector.StartupSettings.Changed";
38 const char kProtectorHistogramStartupSettingsDiscarded[] = 37 const char kProtectorHistogramStartupSettingsDiscarded[] =
39 "Protector.StartupSettings.Discarded"; 38 "Protector.StartupSettings.Discarded";
40 const char kProtectorHistogramStartupSettingsTimeout[] = 39 const char kProtectorHistogramStartupSettingsTimeout[] =
41 "Protector.StartupSettings.Timeout"; 40 "Protector.StartupSettings.Timeout";
42 41
43 const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX; 42 const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX;
44 43
45 int GetSearchProviderHistogramID(const TemplateURL* turl) { 44 int GetSearchProviderHistogramID(const TemplateURL* t_url) {
46 if (!turl || !turl->url()) 45 return (t_url && t_url->url()) ?
47 return SEARCH_ENGINE_NONE; 46 TemplateURLPrepopulateData::GetEngineType(t_url->url()->url()) :
48 scoped_ptr<TemplateURL> prepopulated_url( 47 SEARCH_ENGINE_NONE;
49 TemplateURLPrepopulateData::FindPrepopulatedEngine(turl->url()->url()));
50 if (prepopulated_url.get())
51 return static_cast<int>(prepopulated_url->search_engine_type());
52 // If |turl| is not among the prepopulated providers, return
53 // SEARCH_ENGINE_OTHER as well.
54 return SEARCH_ENGINE_OTHER;
55 } 48 }
56 49
57 } // namespace protector 50 } // namespace protector
OLDNEW
« 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