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

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

Issue 134773004: Include external touchscreen vid/pid in UMA hardware profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't assume a screen exists - it doesn't in some tests. Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/common/metrics/proto/system_profile.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_log_chromeos.cc
diff --git a/chrome/browser/metrics/metrics_log_chromeos.cc b/chrome/browser/metrics/metrics_log_chromeos.cc
index e7762481f22a80faf149dc50dd5dc28bdf4eb6b9..cc1adee5d2f1d05a7ec468c464a329b1834bd727 100644
--- a/chrome/browser/metrics/metrics_log_chromeos.cc
+++ b/chrome/browser/metrics/metrics_log_chromeos.cc
@@ -14,12 +14,17 @@
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/bluetooth_device.h"
+#include "ui/events/event_utils.h"
+#include "ui/events/x/touch_factory_x11.h"
+#include "ui/gfx/screen.h"
using metrics::ChromeUserMetricsExtension;
using metrics::PerfDataProto;
using metrics::SystemProfileProto;
typedef SystemProfileProto::Hardware::Bluetooth::PairedDevice PairedDevice;
+namespace {
+
PairedDevice::Type AsBluetoothDeviceType(
device::BluetoothDevice::DeviceType device_type) {
switch (device_type) {
@@ -57,6 +62,21 @@ PairedDevice::Type AsBluetoothDeviceType(
return PairedDevice::DEVICE_UNKNOWN;
}
+void WriteExternalTouchscreensProto(SystemProfileProto::Hardware* hardware) {
+ std::set<std::pair<int, int> > touchscreen_ids =
+ ui::TouchFactory::GetInstance()->GetTouchscreenIds();
+ for (std::set<std::pair<int, int> >::iterator it = touchscreen_ids.begin();
+ it != touchscreen_ids.end();
+ ++it) {
+ SystemProfileProto::Hardware::TouchScreen* touchscreen =
+ hardware->add_external_touchscreen();
+ touchscreen->set_vendor_id(it->first);
+ touchscreen->set_product_id(it->second);
+ }
+}
+
+} // namespace
+
MetricsLogChromeOS::~MetricsLogChromeOS() {
}
@@ -72,6 +92,15 @@ void MetricsLogChromeOS::LogChromeOSMetrics() {
WriteBluetoothProto();
UpdateMultiProfileUserCount();
+
+ SystemProfileProto::Hardware* hardware =
+ uma_proto_->mutable_system_profile()->mutable_hardware();
+ gfx::Display::TouchSupport has_touch = ui::GetInternalDisplayTouchSupport();
+ if (has_touch == gfx::Display::TOUCH_SUPPORT_AVAILABLE)
+ hardware->set_internal_display_supports_touch(true);
+ else if (has_touch == gfx::Display::TOUCH_SUPPORT_UNAVAILABLE)
+ hardware->set_internal_display_supports_touch(false);
+ WriteExternalTouchscreensProto(hardware);
}
void MetricsLogChromeOS::WriteRealtimeStabilityAttributes(PrefService* pref) {
« no previous file with comments | « no previous file | chrome/common/metrics/proto/system_profile.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698