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

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: 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 PrefService;
20
21 // Performs ChromeOS specific metrics logging.
22 class ChromeOSMetricsProvider : public metrics::MetricsProvider {
23 public:
24 ChromeOSMetricsProvider();
25 virtual ~ChromeOSMetricsProvider();
26
27 // Records a crash.
28 static void LogChromeOSCrash(const std::string& crash_type);
29
30 // metrics::MetricsProvider:
31 virtual void OnDidCreateMetricsLog();
32 virtual void ProvideSystemProfileMetrics(
33 metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
34 virtual void ProvideStabilityMetrics(
35 metrics::SystemProfileProto_Stability* stability_proto) OVERRIDE;
36
37 private:
38 // Update the number of users logged into a multi-profile session.
39 // If the number of users change while the log is open, the call invalidates
40 // the user count value.
41 void UpdateMultiProfileUserCount(
42 metrics::SystemProfileProto* system_profile_proto);
43
44 // Sets the Bluetooth Adapter instance used for the WriteBluetoothProto()
45 // call.
46 void SetBluetoothAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
47
48 // Writes info about paired Bluetooth devices on this system.
49 virtual void WriteBluetoothProto(
Alexei Svitkine (slow) 2014/05/23 08:41:47 Does this still need to be virtual?
blundell 2014/05/23 12:09:22 Done.
50 metrics::SystemProfileProto* system_profile_proto);
51
52 metrics::PerfProvider perf_provider_;
53
54 // Bluetooth Adapter instance for collecting information about paired devices.
55 scoped_refptr<device::BluetoothAdapter> adapter_;
56 metrics::ChromeUserMetricsExtension* uma_proto_;
57
58 // The user count at the time that a log was last initialized.
59 uint64 user_count_at_log_initialization_;
60
61 DISALLOW_COPY_AND_ASSIGN(ChromeOSMetricsProvider);
62 };
63
64 #endif // CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698