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

Unified Diff: chrome/browser/metrics/chromeos_metrics_provider.cc

Issue 301633006: Move ChromeOS hardware class init out of MetricsService. (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.cc
diff --git a/chrome/browser/metrics/chromeos_metrics_provider.cc b/chrome/browser/metrics/chromeos_metrics_provider.cc
index 50123990b3b052d498fd8b109b1aa77e794cfa7f..95e7968a8f0e52f8ea8987c4719d6750cdde08d5 100644
--- a/chrome/browser/metrics/chromeos_metrics_provider.cc
+++ b/chrome/browser/metrics/chromeos_metrics_provider.cc
@@ -13,7 +13,9 @@
#include "chrome/browser/chromeos/login/users/user_manager.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/common/pref_names.h"
+#include "chromeos/system/statistics_provider.h"
#include "components/metrics/proto/chrome_user_metrics_extension.pb.h"
+#include "content/public/browser/browser_thread.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_device.h"
@@ -132,6 +134,26 @@ void ChromeOSMetricsProvider::OnDidCreateMetricsLog() {
}
}
+void ChromeOSMetricsProvider::InitTaskGetHardwareClass(
+ base::MessageLoopProxy* target_loop,
+ const base::Closure& callback) {
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
+
+ chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic(
+ "hardware_class", &hardware_class_);
+
+ target_loop->PostTask(FROM_HERE, callback);
+}
+
+/*
+void ChromeOSMetricsProvider::OnInitTaskGotHardwareClass(
+ const std::string& hardware_class,
+ const base::Callback& callback) {
+ hardware_class_ = hardware_class;
+ callback.Run();
+}
+*/
+
void ChromeOSMetricsProvider::ProvideSystemProfileMetrics(
metrics::SystemProfileProto* system_profile_proto) {
std::vector<PerfDataProto> perf_data;
@@ -148,6 +170,7 @@ void ChromeOSMetricsProvider::ProvideSystemProfileMetrics(
metrics::SystemProfileProto::Hardware* hardware =
system_profile_proto->mutable_hardware();
+ hardware->set_hardware_class(hardware_class_);
gfx::Display::TouchSupport has_touch = ui::GetInternalDisplayTouchSupport();
if (has_touch == gfx::Display::TOUCH_SUPPORT_AVAILABLE)
hardware->set_internal_display_supports_touch(true);

Powered by Google App Engine
This is Rietveld 408576698