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

Side by Side Diff: components/metrics/metrics_service_accessor.h

Issue 2331343012: Create MetricsPrivateDelegate for metricsPrivate behavior (Closed)
Patch Set: ExtensionsAPIClient owns MetricsPrivateDelegate instance Created 4 years, 3 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 COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_ 5 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_
6 #define COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_ 6 #define COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 11 matching lines...) Expand all
22 // specialization and enable access there by declaring friends. 22 // specialization and enable access there by declaring friends.
23 class MetricsServiceAccessor { 23 class MetricsServiceAccessor {
24 protected: 24 protected:
25 // Constructor declared as protected to enable inheritance. Descendants should 25 // Constructor declared as protected to enable inheritance. Descendants should
26 // disallow instantiation. 26 // disallow instantiation.
27 MetricsServiceAccessor() {} 27 MetricsServiceAccessor() {}
28 28
29 // Returns whether metrics reporting is enabled, using the value of the 29 // Returns whether metrics reporting is enabled, using the value of the
30 // kMetricsReportingEnabled pref in |pref_service| to determine whether user 30 // kMetricsReportingEnabled pref in |pref_service| to determine whether user
31 // has enabled reporting. 31 // has enabled reporting.
32 // NOTE: This method currently does not return the correct value on ChromeOS 32 // NOTE: This method currently does not return the correct value on Android
Ilya Sherman 2016/09/23 22:39:59 Is your CL changing something about the correctnes
michaelpg 2016/09/23 23:48:15 No. The method seems to have already been correcte
Ilya Sherman 2016/09/27 01:33:13 Yes please, and send the code review to gayane@, a
michaelpg 2016/09/27 16:45:16 Looks like gayane@ beat me to it! https://coderevi
Ilya Sherman 2016/09/27 21:16:49 Great! Please make sure to remember to revert you
michaelpg 2016/09/30 22:15:01 Done.
33 // and Android due to http://crbug.com/362192 and http://crbug.com/532084. See 33 // due to http://crbug.com/362192 and http://crbug.com/532084. See
34 // ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled(). 34 // ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled().
35 static bool IsMetricsReportingEnabled(PrefService* pref_service); 35 static bool IsMetricsReportingEnabled(PrefService* pref_service);
36 36
37 // Returns whether metrics reporting is enabled, using the value of 37 // Returns whether metrics reporting is enabled, using the value of
38 // |enabled_in_prefs| to determine whether the user has enabled reporting. 38 // |enabled_in_prefs| to determine whether the user has enabled reporting.
39 // Exists because kMetricsReportingEnabled is currently not used on all 39 // Exists because kMetricsReportingEnabled is currently not used on all
40 // platforms. 40 // platforms.
41 // TODO(gayane): Consolidate metric prefs on all platforms and eliminate this 41 // TODO(gayane): Consolidate metric prefs on all platforms and eliminate this
42 // method. http://crbug.com/362192, http://crbug.com/532084 42 // method. http://crbug.com/362192, http://crbug.com/532084
43 static bool IsMetricsReportingEnabledWithPrefValue(bool enabled_in_prefs); 43 static bool IsMetricsReportingEnabledWithPrefValue(bool enabled_in_prefs);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 uint32_t trial_name_hash, 75 uint32_t trial_name_hash,
76 uint32_t group_name_hash); 76 uint32_t group_name_hash);
77 77
78 private: 78 private:
79 DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor); 79 DISALLOW_COPY_AND_ASSIGN(MetricsServiceAccessor);
80 }; 80 };
81 81
82 } // namespace metrics 82 } // namespace metrics
83 83
84 #endif // COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_ 84 #endif // COMPONENTS_METRICS_METRICS_SERVICE_ACCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698