| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "services/ui/public/cpp/window_tree_client.h" | 5 #include "services/ui/public/cpp/window_tree_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 } | 996 } |
| 997 | 997 |
| 998 std::unique_ptr<base::Callback<void(mojom::EventResult)>> ack_callback( | 998 std::unique_ptr<base::Callback<void(mojom::EventResult)>> ack_callback( |
| 999 new base::Callback<void(mojom::EventResult)>( | 999 new base::Callback<void(mojom::EventResult)>( |
| 1000 base::Bind(&mojom::WindowTree::OnWindowInputEventAck, | 1000 base::Bind(&mojom::WindowTree::OnWindowInputEventAck, |
| 1001 base::Unretained(tree_), event_id))); | 1001 base::Unretained(tree_), event_id))); |
| 1002 | 1002 |
| 1003 // TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or | 1003 // TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or |
| 1004 // ui::TouchEvent once we have proper support for pointer events. | 1004 // ui::TouchEvent once we have proper support for pointer events. |
| 1005 if (event->IsMousePointerEvent()) { | 1005 if (event->IsMousePointerEvent()) { |
| 1006 window->input_event_handler_->OnWindowInputEvent( | 1006 if (event->type() == ui::ET_POINTER_WHEEL_CHANGED) { |
| 1007 window, ui::MouseEvent(*event->AsPointerEvent()), &ack_callback); | 1007 window->input_event_handler_->OnWindowInputEvent( |
| 1008 window, ui::MouseWheelEvent(*event->AsPointerEvent()), &ack_callback); |
| 1009 } else { |
| 1010 window->input_event_handler_->OnWindowInputEvent( |
| 1011 window, ui::MouseEvent(*event->AsPointerEvent()), &ack_callback); |
| 1012 } |
| 1008 } else if (event->IsTouchPointerEvent()) { | 1013 } else if (event->IsTouchPointerEvent()) { |
| 1009 window->input_event_handler_->OnWindowInputEvent( | 1014 window->input_event_handler_->OnWindowInputEvent( |
| 1010 window, ui::TouchEvent(*event->AsPointerEvent()), &ack_callback); | 1015 window, ui::TouchEvent(*event->AsPointerEvent()), &ack_callback); |
| 1011 } else { | 1016 } else { |
| 1012 window->input_event_handler_->OnWindowInputEvent(window, *event.get(), | 1017 window->input_event_handler_->OnWindowInputEvent(window, *event.get(), |
| 1013 &ack_callback); | 1018 &ack_callback); |
| 1014 } | 1019 } |
| 1015 | 1020 |
| 1016 // The handler did not take ownership of the callback, so we send the ack, | 1021 // The handler did not take ownership of the callback, so we send the ack, |
| 1017 // marking the event as not consumed. | 1022 // marking the event as not consumed. |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 Window* window, | 1266 Window* window, |
| 1262 const gfx::Vector2d& offset, | 1267 const gfx::Vector2d& offset, |
| 1263 const gfx::Insets& hit_area) { | 1268 const gfx::Insets& hit_area) { |
| 1264 if (window_manager_internal_client_) { | 1269 if (window_manager_internal_client_) { |
| 1265 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1270 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1266 server_id(window), offset.x(), offset.y(), hit_area); | 1271 server_id(window), offset.x(), offset.y(), hit_area); |
| 1267 } | 1272 } |
| 1268 } | 1273 } |
| 1269 | 1274 |
| 1270 } // namespace ui | 1275 } // namespace ui |
| OLD | NEW |