Chromium Code Reviews| Index: chrome/browser/metrics/metrics_log.cc |
| diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc |
| index ba2117de3f41a4ba8e2644a0ebbf0527101f0ccc..4820c166d21bc268bb27d5bffd14ef1b0d58ca31 100644 |
| --- a/chrome/browser/metrics/metrics_log.cc |
| +++ b/chrome/browser/metrics/metrics_log.cc |
| @@ -66,6 +66,7 @@ extern "C" IMAGE_DOS_HEADER __ImageBase; |
| #if defined(OS_CHROMEOS) |
| #include "chrome/browser/chromeos/login/user_manager.h" |
| +#include "ui/events/x/touch_factory_x11.h" |
| #endif |
| using content::GpuDataManager; |
| @@ -380,6 +381,22 @@ PairedDevice::Type AsBluetoothDeviceType( |
| NOTREACHED(); |
| return PairedDevice::DEVICE_UNKNOWN; |
| } |
| + |
| +void WriteTouchscreensProto(SystemProfileProto::Hardware* hardware) { |
| + ui::TouchFactory* touch_factory = ui::TouchFactory::GetInstance(); |
| + |
| + hardware->set_is_touchscreen_present(touch_factory->IsTouchDevicePresent()); |
| + |
| + std::set<std::pair<int, int> > touchscreen_ids = |
| + touch_factory->GetTouchscreenIds(); |
| + std::set<std::pair<int, int> >::iterator it; |
|
Ilya Sherman
2013/12/12 22:49:43
nit: Please declare this within the scope of the f
tdresser
2013/12/13 15:29:00
Done.
|
| + for (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); |
| + } |
| +} |
| #endif // defined(OS_CHROMEOS) |
| // Round a timestamp measured in seconds since epoch to one with a granularity |
| @@ -806,6 +823,7 @@ void MetricsLog::RecordEnvironment( |
| base::Unretained(this))); |
| DCHECK(adapter_.get()); |
| WriteBluetoothProto(hardware); |
| + WriteTouchscreensProto(hardware); |
| UpdateMultiProfileUserCount(); |
| #endif |