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

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

Issue 292433015: Refactor MetricsLogChromeOS to ChromeOSMetricsProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Build fixes Created 6 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
6 #define CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
7
8 #include "chrome/browser/metrics/perf_provider_chromeos.h"
9 #include "components/metrics/metrics_provider.h"
10
11 namespace device {
12 class BluetoothAdapter;
13 }
14
15 namespace metrics {
16 class ChromeUserMetricsExtension;
17 }
18
19 class PrefRegistrySimple;
20 class PrefService;
21
22 // Performs ChromeOS specific metrics logging.
23 class ChromeOSMetricsProvider : public metrics::MetricsProvider {
24 public:
25 ChromeOSMetricsProvider();
26 virtual ~ChromeOSMetricsProvider();
27
28 static void RegisterPrefs(PrefRegistrySimple* registry);
29
30 // Records a crash.
31 static void LogCrash(const std::string& crash_type);
32
33 // metrics::MetricsProvider:
34 virtual void OnDidCreateMetricsLog() OVERRIDE;
35 virtual void ProvideSystemProfileMetrics(
36 metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
37 virtual void ProvideStabilityMetrics(
38 metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
39
40 private:
41 // Update the number of users logged into a multi-profile session.
42 // If the number of users change while the log is open, the call invalidates
43 // the user count value.
44 void UpdateMultiProfileUserCount(
45 metrics::SystemProfileProto* system_profile_proto);
46
47 // Sets the Bluetooth Adapter instance used for the WriteBluetoothProto()
48 // call.
49 void SetBluetoothAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
50
51 // Writes info about paired Bluetooth devices on this system.
52 void WriteBluetoothProto(metrics::SystemProfileProto* system_profile_proto);
53
54 metrics::PerfProvider perf_provider_;
55
56 // Bluetooth Adapter instance for collecting information about paired devices.
57 scoped_refptr<device::BluetoothAdapter> adapter_;
58 metrics::ChromeUserMetricsExtension* uma_proto_;
59
60 // Whether the user count was registered at the last log initialization.
61 bool registered_user_count_at_log_initialization_;
62
63 // The user count at the time that a log was last initialized. Contains a
64 // valid value only if |registered_user_count_at_log_initialization_| is
65 // true.
66 uint64 user_count_at_log_initialization_;
67
68 DISALLOW_COPY_AND_ASSIGN(ChromeOSMetricsProvider);
69 };
70
71 #endif // CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/external_metrics.cc ('k') | chrome/browser/metrics/chromeos_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698