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

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

Issue 506663003: Consolidates accessing and setting the UMA pref to be within metrics code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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_CHROME_METRICS_SERVICE_ACCESSOR_H_ 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_
6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/metrics/metrics_service_accessor.h" 13 #include "chrome/browser/metrics/metrics_service_accessor.h"
14 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
14 15
15 class ChromeBrowserMetricsServiceObserver; 16 class ChromeBrowserMetricsServiceObserver;
16 class Profile; 17 class Profile;
17 18
18 namespace { 19 namespace {
19 class CrashesDOMHandler; 20 class CrashesDOMHandler;
20 class FlashDOMHandler; 21 class FlashDOMHandler;
21 } 22 }
22 23
23 namespace extensions { 24 namespace extensions {
(...skipping 19 matching lines...) Expand all
43 friend class ::ChromeBrowserMetricsServiceObserver; 44 friend class ::ChromeBrowserMetricsServiceObserver;
44 friend class ChromeRenderMessageFilter; 45 friend class ChromeRenderMessageFilter;
45 friend class ::CrashesDOMHandler; 46 friend class ::CrashesDOMHandler;
46 friend class DataReductionProxyChromeSettings; 47 friend class DataReductionProxyChromeSettings;
47 friend class extensions::ExtensionDownloader; 48 friend class extensions::ExtensionDownloader;
48 friend class extensions::ManifestFetchData; 49 friend class extensions::ManifestFetchData;
49 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction; 50 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction;
50 friend class ::FlashDOMHandler; 51 friend class ::FlashDOMHandler;
51 friend class system_logs::ChromeInternalLogSource; 52 friend class system_logs::ChromeInternalLogSource;
52 friend class UmaSessionStats; 53 friend class UmaSessionStats;
54 friend class options::BrowserOptionsHandler;
53 55
54 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, 56 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest,
55 MetricsReportingEnabled); 57 MetricsReportingEnabled);
56 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, 58 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest,
57 CrashReportingEnabled); 59 CrashReportingEnabled);
58 60
59 // Returns true if prefs::kMetricsReportingEnabled is set. 61 // Returns true if prefs::kMetricsReportingEnabled is set.
60 // TODO(asvitkine): Consolidate the method in MetricsStateManager. 62 // TODO(asvitkine): Consolidate the method in MetricsStateManager.
61 // TODO(asvitkine): This function does not report the correct value on 63 // TODO(asvitkine): This function does not report the correct value on
62 // Android and ChromeOS, see http://crbug.com/362192. 64 // Android and ChromeOS, see http://crbug.com/362192.
(...skipping 17 matching lines...) Expand all
80 // Same as RegisterSyntheticFieldTrial above, but takes a hash for the trial 82 // Same as RegisterSyntheticFieldTrial above, but takes a hash for the trial
81 // name, rather than computing it from the string. 83 // name, rather than computing it from the string.
82 static bool RegisterSyntheticFieldTrialWithNameHash( 84 static bool RegisterSyntheticFieldTrialWithNameHash(
83 uint32_t trial_name_hash, 85 uint32_t trial_name_hash,
84 const std::string& group_name); 86 const std::string& group_name);
85 87
86 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); 88 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor);
87 }; 89 };
88 90
89 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ 91 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698