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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/chromeos_metrics_provider.h
diff --git a/chrome/browser/metrics/chromeos_metrics_provider.h b/chrome/browser/metrics/chromeos_metrics_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..7ed1bd20347e6b7ac2f53009514ab750bfbba294
--- /dev/null
+++ b/chrome/browser/metrics/chromeos_metrics_provider.h
@@ -0,0 +1,64 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
+#define CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_
+
+#include "chrome/browser/metrics/perf_provider_chromeos.h"
+#include "components/metrics/metrics_provider.h"
+
+namespace device {
+class BluetoothAdapter;
+}
+
+namespace metrics {
+class ChromeUserMetricsExtension;
+}
+
+class PrefService;
+
+// Performs ChromeOS specific metrics logging.
+class ChromeOSMetricsProvider : public metrics::MetricsProvider {
+ public:
+ ChromeOSMetricsProvider();
+ virtual ~ChromeOSMetricsProvider();
+
+ // Records a crash.
+ static void LogChromeOSCrash(const std::string& crash_type);
+
+ // metrics::MetricsProvider:
+ virtual void OnDidCreateMetricsLog();
+ virtual void ProvideSystemProfileMetrics(
+ metrics::SystemProfileProto* system_profile_proto) OVERRIDE;
+ virtual void ProvideStabilityMetrics(
+ metrics::SystemProfileProto_Stability* stability_proto) OVERRIDE;
+
+ private:
+ // Update the number of users logged into a multi-profile session.
+ // If the number of users change while the log is open, the call invalidates
+ // the user count value.
+ void UpdateMultiProfileUserCount(
+ metrics::SystemProfileProto* system_profile_proto);
+
+ // Sets the Bluetooth Adapter instance used for the WriteBluetoothProto()
+ // call.
+ void SetBluetoothAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
+
+ // Writes info about paired Bluetooth devices on this system.
+ 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.
+ metrics::SystemProfileProto* system_profile_proto);
+
+ metrics::PerfProvider perf_provider_;
+
+ // Bluetooth Adapter instance for collecting information about paired devices.
+ scoped_refptr<device::BluetoothAdapter> adapter_;
+ metrics::ChromeUserMetricsExtension* uma_proto_;
+
+ // The user count at the time that a log was last initialized.
+ uint64 user_count_at_log_initialization_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeOSMetricsProvider);
+};
+
+#endif // CHROME_BROWSER_METRICS_CHROMEOS_METRICS_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698