Index: ui/events/event_utils.cc |
diff --git a/ui/events/event_utils.cc b/ui/events/event_utils.cc |
index 5504e4cb39958558818b1190bf38a8a27d1c36a8..a8c95da6f8ffb475c5782c8a32cad8401731b9d2 100644 |
--- a/ui/events/event_utils.cc |
+++ b/ui/events/event_utils.cc |
@@ -4,7 +4,11 @@ |
#include "ui/events/event_utils.h" |
+#include <vector> |
+ |
#include "ui/events/event.h" |
+#include "ui/gfx/display.h" |
+#include "ui/gfx/screen.h" |
namespace ui { |
@@ -25,4 +29,19 @@ base::TimeDelta EventTimeForNow() { |
base::TimeTicks::Now().ToInternalValue()); |
} |
+bool ShouldDefaultToNaturalScroll() { |
+ gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE); |
+ if (!screen) |
+ return false; |
+ 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; |
+ } |
+ return false; |
+} |
+ |
} // namespace ui |