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

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: Address oshima's comments. Created 6 years, 11 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 | « ui/events/event_utils.h ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_utils.cc
diff --git a/ui/events/event_utils.cc b/ui/events/event_utils.cc
index 8a3ba6699fedc37c674b88f900a9286aedceac50..8056c0c09775f19594995a82c4bf6e57d9f1820f 100644
--- a/ui/events/event_utils.cc
+++ b/ui/events/event_utils.cc
@@ -26,18 +26,20 @@ base::TimeDelta EventTimeForNow() {
}
bool ShouldDefaultToNaturalScroll() {
+ return InternalDisplaySupportsTouch() ==
+ gfx::Display::TOUCH_SUPPORT_AVAILABLE;
+}
+
+gfx::Display::TouchSupport InternalDisplaySupportsTouch() {
oshima 2014/01/17 20:49:47 GetInternalDisplayTouchSupport() ?
tdresser 2014/01/17 21:34:54 Done.
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
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698