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 cc231453429d609070f972753845b4f4e97a7be5..51cf3ab34094f578f9af89ff6a95fa890ebdc8b5 100644 |
| --- a/chrome/browser/metrics/metrics_log.cc |
| +++ b/chrome/browser/metrics/metrics_log.cc |
| @@ -8,6 +8,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "ash/shell.h" |
|
Alexei Svitkine (slow)
2014/01/28 16:01:06
Is this header valid to include on all platforms?
|
| #include "base/base64.h" |
| #include "base/basictypes.h" |
| #include "base/bind.h" |
| @@ -50,6 +51,7 @@ |
| #include "device/bluetooth/bluetooth_adapter_factory.h" |
| #include "device/bluetooth/bluetooth_device.h" |
| #include "gpu/config/gpu_info.h" |
| +#include "ui/events/event_utils.h" |
| #include "ui/gfx/screen.h" |
| #include "url/gurl.h" |
| @@ -66,6 +68,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 +383,19 @@ PairedDevice::Type AsBluetoothDeviceType( |
| NOTREACHED(); |
| 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); |
| + } |
| +} |
| #endif // defined(OS_CHROMEOS) |
| // Round a timestamp measured in seconds since epoch to one with a granularity |
| @@ -801,6 +817,12 @@ void MetricsLog::RecordEnvironment( |
| uma_proto()->add_perf_data()->Swap(&perf_data_proto); |
| WriteBluetoothProto(hardware); |
| + gfx::Display::TouchSupport has_touch = ui::GetInternalDisplayTouchSupport(); |
|
Alexei Svitkine (slow)
2014/01/28 16:01:06
I think this ChromeOS-specific code in this class
|
| + 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); |
| UpdateMultiProfileUserCount(); |
| #endif |