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

Unified Diff: ui/events/event_utils.cc

Issue 134773004: Include external touchscreen vid/pid in UMA hardware profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto refactor. 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
Index: ui/events/event_utils.cc
diff --git a/ui/events/event_utils.cc b/ui/events/event_utils.cc
index 8a3ba6699fedc37c674b88f900a9286aedceac50..2086819944aeaa5d739917e330a7e7e2786bf7d2 100644
--- a/ui/events/event_utils.cc
+++ b/ui/events/event_utils.cc
@@ -26,18 +26,20 @@ base::TimeDelta EventTimeForNow() {
}
bool ShouldDefaultToNaturalScroll() {
+ return GetInternalDisplayTouchSupport() ==
+ gfx::Display::TOUCH_SUPPORT_AVAILABLE;
+}
+
+gfx::Display::TouchSupport GetInternalDisplayTouchSupport() {
gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE);
- if (!screen)
- return false;
+ CHECK(screen);
const std::vector<gfx::Display>& displays = screen->GetAllDisplays();
for (std::vector<gfx::Display>::const_iterator it = displays.begin();
it != displays.end(); ++it) {
- const gfx::Display& display = *it;
- if (display.IsInternal() &&
- display.touch_support() == gfx::Display::TOUCH_SUPPORT_AVAILABLE)
- return true;
+ if (it->IsInternal())
+ return it->touch_support();
}
- return false;
+ return gfx::Display::TOUCH_SUPPORT_UNAVAILABLE;
}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698