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

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

Issue 937013002: Propogate RAPPOR permission changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_services_manager.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 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/prefs/pref_change_registrar.h"
10 #include "base/threading/thread_checker.h" 11 #include "base/threading/thread_checker.h"
11 #include "components/rappor/rappor_service.h" 12 #include "components/rappor/rappor_service.h"
12 13
13 class ChromeMetricsServiceClient; 14 class ChromeMetricsServiceClient;
14 class PrefService; 15 class PrefService;
15 16
16 namespace base { 17 namespace base {
17 class FilePath; 18 class FilePath;
18 } 19 }
19 20
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Update the managed services when permissions for uploading metrics change. 60 // Update the managed services when permissions for uploading metrics change.
60 void UpdateUploadPermissions(bool may_upload); 61 void UpdateUploadPermissions(bool may_upload);
61 62
62 // Returns true iff Rappor reporting is enabled. 63 // Returns true iff Rappor reporting is enabled.
63 bool IsRapporEnabled(bool metrics_enabled) const; 64 bool IsRapporEnabled(bool metrics_enabled) const;
64 65
65 // Returns the recording level for Rappor metrics. 66 // Returns the recording level for Rappor metrics.
66 rappor::RecordingLevel GetRapporRecordingLevel(bool metrics_enabled) const; 67 rappor::RecordingLevel GetRapporRecordingLevel(bool metrics_enabled) const;
67 68
68 private: 69 private:
70 // Update the managed services when permissions for recording/uploading
71 // metrics change.
72 void UpdateRapporService();
73
69 // Returns the ChromeMetricsServiceClient, creating it if it hasn't been 74 // Returns the ChromeMetricsServiceClient, creating it if it hasn't been
70 // created yet (and additionally creating the MetricsService in that case). 75 // created yet (and additionally creating the MetricsService in that case).
71 ChromeMetricsServiceClient* GetChromeMetricsServiceClient(); 76 ChromeMetricsServiceClient* GetChromeMetricsServiceClient();
72 77
73 metrics::MetricsStateManager* GetMetricsStateManager(); 78 metrics::MetricsStateManager* GetMetricsStateManager();
74 79
75 // Ensures that all functions are called from the same thread. 80 // Ensures that all functions are called from the same thread.
76 base::ThreadChecker thread_checker_; 81 base::ThreadChecker thread_checker_;
77 82
78 // Weak pointer to the local state prefs store. 83 // Weak pointer to the local state prefs store.
79 PrefService* local_state_; 84 PrefService* local_state_;
80 85
86 // A change registrar for local_state_;
87 PrefChangeRegistrar pref_change_registrar_;
88
89 // The current metrics reporting setting.
90 bool may_upload_;
91
92 // The current metrics recording setting.
93 bool may_record_;
94
81 // MetricsStateManager which is passed as a parameter to service constructors. 95 // MetricsStateManager which is passed as a parameter to service constructors.
82 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_; 96 scoped_ptr<metrics::MetricsStateManager> metrics_state_manager_;
83 97
84 // Chrome embedder implementation of the MetricsServiceClient. Owns the 98 // Chrome embedder implementation of the MetricsServiceClient. Owns the
85 // MetricsService. 99 // MetricsService.
86 scoped_ptr<ChromeMetricsServiceClient> metrics_service_client_; 100 scoped_ptr<ChromeMetricsServiceClient> metrics_service_client_;
87 101
88 // The RapporService, for RAPPOR metric uploads. 102 // The RapporService, for RAPPOR metric uploads.
89 scoped_ptr<rappor::RapporService> rappor_service_; 103 scoped_ptr<rappor::RapporService> rappor_service_;
90 104
91 // The VariationsService, for server-side experiments infrastructure. 105 // The VariationsService, for server-side experiments infrastructure.
92 scoped_ptr<chrome_variations::VariationsService> variations_service_; 106 scoped_ptr<chrome_variations::VariationsService> variations_service_;
93 107
94 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager); 108 DISALLOW_COPY_AND_ASSIGN(MetricsServicesManager);
95 }; 109 };
96 110
97 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_ 111 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICES_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_services_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698