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

Side by Side 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: Review fixes. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/protector/histograms.h ('k') | chrome/browser/protector/protector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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"
8 #include "chrome/browser/search_engines/search_engine_type.h"
9 #include "chrome/browser/search_engines/template_url.h"
10 #include "chrome/browser/search_engines/template_url_prepopulate_data.h"
11
7 namespace protector { 12 namespace protector {
8 13
9 const char kProtectorHistogramDefaultSearchProvider[] = 14 const char kProtectorHistogramDefaultSearchProvider[] =
10 "Protector.DefaultSearchProvider"; 15 "Protector.DefaultSearchProvider";
11 16
12 const char kProtectorBackupInvalidCounter[] = 17 const char kProtectorBackupInvalidCounter[] =
13 "Protector.BackupInvalidCounter"; 18 "Protector.BackupInvalidCounter";
14 const char kProtectorValueChangedCounter[] = "Protector.ValueChangedCounter"; 19 const char kProtectorValueChangedCounter[] = "Protector.ValueChangedCounter";
15 const char kProtectorValueValidCounter[] = "Protector.ValueValidCounter"; 20 const char kProtectorValueValidCounter[] = "Protector.ValueValidCounter";
16 21
22 const char kProtectorHistogramNewSearchProvider[] =
23 "Protector.NewSearchProvider";
24 const char kProtectorHistogramSearchProviderApplied[] =
25 "Protector.SearchProviderApplied";
26 const char kProtectorHistogramSearchProviderDiscarded[] =
27 "Protector.SearchProviderDiscarded";
28 const char kProtectorHistogramSearchProviderTimeout[] =
29 "Protector.SearchProviderTimeout";
30
31 const int kProtectorMaxSearchProviderID = SEARCH_ENGINE_MAX;
32
33 int GetSearchProviderHistogramID(const TemplateURL* t_url) {
34 if (t_url && t_url->url()) {
35 scoped_ptr<TemplateURL> prepopulated_url(
36 TemplateURLPrepopulateData::FindPrepopulatedEngine(
37 t_url->url()->url()));
38 if (prepopulated_url.get())
39 return static_cast<int>(prepopulated_url->search_engine_type());
40 }
41 // If |t_url| is NULL or not among the prepopulated providers, return
42 // SEARCH_ENGINE_OTHER as well.
43 return SEARCH_ENGINE_OTHER;
44 }
45
17 } // namespace protector 46 } // namespace protector
OLDNEW
« no previous file with comments | « chrome/browser/protector/histograms.h ('k') | chrome/browser/protector/protector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698