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

Unified Diff: services/window_manager/window_manager_app.cc

Issue 789363004: WindowManagerApp should recognize gestures (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rename Aura to Impl and add FIXME Created 5 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 | « services/window_manager/window_manager_app.h ('k') | ui/events/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/window_manager/window_manager_app.cc
diff --git a/services/window_manager/window_manager_app.cc b/services/window_manager/window_manager_app.cc
index ba7b75d37d2d7007ffc9a328fd1292dc8bb0a52a..3a2b15546abfeedf0c543ab97beb2a3217d2f90d 100644
--- a/services/window_manager/window_manager_app.cc
+++ b/services/window_manager/window_manager_app.cc
@@ -55,7 +55,8 @@ WindowManagerApp::WindowManagerApp(
native_viewport_event_dispatcher_factory_(this),
wrapped_view_manager_delegate_(view_manager_delegate),
window_manager_delegate_(window_manager_delegate),
- root_(nullptr) {
+ root_(nullptr),
+ gesture_provider_(this) {
}
WindowManagerApp::~WindowManagerApp() {
@@ -219,6 +220,27 @@ void WindowManagerApp::OnEvent(ui::Event* event) {
window_manager_client_->DispatchInputEventToView(view->id(),
mojo::Event::From(*event));
+
+ if (event->IsTouchEvent()) {
+ gesture_provider_.OnTouchEvent(*static_cast<ui::TouchEvent*>(event));
+ scoped_ptr<ScopedVector<ui::GestureEvent>> gestures(
+ gesture_provider_.GetAndResetPendingGestures());
+ if (gestures) {
+ for (auto& gesture : *gestures) {
+ window_manager_client_->DispatchInputEventToView(
+ view->id(), mojo::Event::From(*gesture));
+ }
+ }
+ gesture_provider_.OnTouchEventAck(false);
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// WindowManagerApp, ui::GestureProviderImplClient implementation:
+
+void WindowManagerApp::OnGestureEvent(ui::GestureEvent* event) {
+ DCHECK(!event->IsTouchEvent());
+ // TODO(abarth): Do we need to dispatch this |event|?
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « services/window_manager/window_manager_app.h ('k') | ui/events/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698