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

Unified Diff: ui/events/event_utils.cc

Issue 42863003: cros: Default to natural scrolling if the internal diplay is a touchscreen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 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/gfx/display.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 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
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/gfx/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698