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

Side by Side Diff: chrome/browser/metrics/metrics_services_manager.h

Issue 308433004: Reduce plugin_metrics_provider_ usage in MetricsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ 5 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_
6 #define CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ 6 #define CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/threading/thread_checker.h" 10 #include "base/threading/thread_checker.h"
11 #include "chrome/browser/metrics/chrome_metrics_service_client.h" 11 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
12 12
13 class MetricsService; 13 class MetricsService;
14 class PluginMetricsProvider;
14 class PrefService; 15 class PrefService;
15 16
16 namespace metrics { 17 namespace metrics {
17 class MetricsStateManager; 18 class MetricsStateManager;
18 } 19 }
19 20
20 namespace rappor { 21 namespace rappor {
21 class RapporService; 22 class RapporService;
22 } 23 }
23 24
24 namespace chrome_variations { 25 namespace chrome_variations {
25 class VariationsService; 26 class VariationsService;
26 } 27 }
27 28
28 // MetricsServicesManager is a helper class that has ownership over the various 29 // MetricsServicesManager is a helper class that has ownership over the various
29 // metrics-related services in Chrome: MetricsService, RapporService and 30 // metrics-related services in Chrome: MetricsService, RapporService and
30 // VariationsService. 31 // VariationsService.
31 class MetricsServicesManager { 32 class MetricsServicesManager {
32 public: 33 public:
33 // Creates the MetricsServicesManager with the |local_state| prefs service. 34 // Creates the MetricsServicesManager with the |local_state| prefs service.
34 explicit MetricsServicesManager(PrefService* local_state); 35 explicit MetricsServicesManager(PrefService* local_state);
35 virtual ~MetricsServicesManager(); 36 virtual ~MetricsServicesManager();
36 37
37 // Returns the MetricsService, creating it if it hasn't been created yet. 38 // Returns the MetricsService, creating it if it hasn't been created yet.
38 MetricsService* GetMetricsService(); 39 MetricsService* GetMetricsService();
39 40
41 // Returns the PluginMetricsProvider or NULL if plugins aren't enabled.
42 PluginMetricsProvider* GetPluginMetricsProvider();
43
40 // Returns the GetRapporService, creating it if it hasn't been created yet. 44 // Returns the GetRapporService, creating it if it hasn't been created yet.
41 rappor::RapporService* GetRapporService(); 45 rappor::RapporService* GetRapporService();
42 46
43 // Returns the VariationsService, creating it if it hasn't been created yet. 47 // Returns the VariationsService, creating it if it hasn't been created yet.
44 chrome_variations::VariationsService* GetVariationsService(); 48 chrome_variations::VariationsService* GetVariationsService();
45 49
46 private: 50 private:
47 metrics::MetricsStateManager* GetMetricsStateManager(); 51 metrics::MetricsStateManager* GetMetricsStateManager();
48 52
49 // Returns true iff metrics reporting is enabled. 53 // Returns true iff metrics reporting is enabled.
(...skipping 18 matching lines...) Expand all
68 // The RapporService, for RAPPOR metric uploads. 72 // The RapporService, for RAPPOR metric uploads.
69 scoped_ptr<rappor::RapporService> rappor_service_; 73 scoped_ptr<rappor::RapporService> rappor_service_;
70 74
71 // The VariationsService, for server-side experiments infrastructure. 75 // The VariationsService, for server-side experiments infrastructure.
72 scoped_ptr<chrome_variations::VariationsService> variations_service_; 76 scoped_ptr<chrome_variations::VariationsService> variations_service_;
73 77
74 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); 78 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager);
75 }; 79 };
76 80
77 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ 81 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698