| 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 "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/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 24 matching lines...) Expand all Loading... |
| 35 #include "ui/aura/mus/property_utils.h" | 35 #include "ui/aura/mus/property_utils.h" |
| 36 #include "ui/aura/mus/window_manager_delegate.h" | 36 #include "ui/aura/mus/window_manager_delegate.h" |
| 37 #include "ui/aura/mus/window_mus.h" | 37 #include "ui/aura/mus/window_mus.h" |
| 38 #include "ui/aura/mus/window_port_mus.h" | 38 #include "ui/aura/mus/window_port_mus.h" |
| 39 #include "ui/aura/mus/window_tree_client_delegate.h" | 39 #include "ui/aura/mus/window_tree_client_delegate.h" |
| 40 #include "ui/aura/mus/window_tree_client_observer.h" | 40 #include "ui/aura/mus/window_tree_client_observer.h" |
| 41 #include "ui/aura/mus/window_tree_client_test_observer.h" | 41 #include "ui/aura/mus/window_tree_client_test_observer.h" |
| 42 #include "ui/aura/mus/window_tree_host_mus.h" | 42 #include "ui/aura/mus/window_tree_host_mus.h" |
| 43 #include "ui/aura/window.h" | 43 #include "ui/aura/window.h" |
| 44 #include "ui/aura/window_delegate.h" | 44 #include "ui/aura/window_delegate.h" |
| 45 #include "ui/aura/window_event_dispatcher.h" |
| 45 #include "ui/aura/window_tracker.h" | 46 #include "ui/aura/window_tracker.h" |
| 46 #include "ui/base/ui_base_types.h" | 47 #include "ui/base/ui_base_types.h" |
| 47 #include "ui/display/display.h" | 48 #include "ui/display/display.h" |
| 48 #include "ui/display/screen.h" | 49 #include "ui/display/screen.h" |
| 49 #include "ui/events/event.h" | 50 #include "ui/events/event.h" |
| 50 #include "ui/gfx/geometry/dip_util.h" | 51 #include "ui/gfx/geometry/dip_util.h" |
| 51 #include "ui/gfx/geometry/insets.h" | 52 #include "ui/gfx/geometry/insets.h" |
| 52 #include "ui/gfx/geometry/size.h" | 53 #include "ui/gfx/geometry/size.h" |
| 53 | 54 |
| 54 #if defined(HiWord) | 55 #if defined(HiWord) |
| (...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 tree_->OnWindowInputEventAck(event_id, ui::mojom::EventResult::UNHANDLED); | 1146 tree_->OnWindowInputEventAck(event_id, ui::mojom::EventResult::UNHANDLED); |
| 1146 return; | 1147 return; |
| 1147 } | 1148 } |
| 1148 | 1149 |
| 1149 WindowTreeHostMus* host = GetWindowTreeHostMus(window); | 1150 WindowTreeHostMus* host = GetWindowTreeHostMus(window); |
| 1150 DCHECK(host); | 1151 DCHECK(host); |
| 1151 | 1152 |
| 1152 // The location of the event is relative to |window|. As the event is handed | 1153 // The location of the event is relative to |window|. As the event is handed |
| 1153 // to WindowTreeHost we need it to be relative to WindowTreeHost. | 1154 // to WindowTreeHost we need it to be relative to WindowTreeHost. |
| 1154 if (event->IsLocatedEvent()) { | 1155 if (event->IsLocatedEvent()) { |
| 1155 gfx::Point host_location = event->AsLocatedEvent()->location(); | 1156 gfx::Point host_location_in_pixels = event->AsLocatedEvent()->location(); |
| 1157 gfx::Point host_location_in_dip = gfx::ConvertPointToDIP( |
| 1158 ScaleFactorForDisplay(window->GetWindow()), host_location_in_pixels); |
| 1156 aura::Window::ConvertPointToTarget(window->GetWindow(), host->window(), | 1159 aura::Window::ConvertPointToTarget(window->GetWindow(), host->window(), |
| 1157 &host_location); | 1160 &host_location_in_dip); |
| 1158 event->AsLocatedEvent()->set_location(host_location); | 1161 event->AsLocatedEvent()->set_location(host_location_in_dip); |
| 1162 window->GetWindow()->GetHost()->dispatcher()->set_transform_events(false); |
| 1159 } | 1163 } |
| 1160 | 1164 |
| 1161 EventAckHandler ack_handler(CreateEventResultCallback(event_id)); | 1165 EventAckHandler ack_handler(CreateEventResultCallback(event_id)); |
| 1162 // TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or | 1166 // TODO(moshayedi): crbug.com/617222. No need to convert to ui::MouseEvent or |
| 1163 // ui::TouchEvent once we have proper support for pointer events. | 1167 // ui::TouchEvent once we have proper support for pointer events. |
| 1164 if (event->IsMousePointerEvent()) { | 1168 if (event->IsMousePointerEvent()) { |
| 1165 if (event->type() == ui::ET_POINTER_WHEEL_CHANGED) { | 1169 if (event->type() == ui::ET_POINTER_WHEEL_CHANGED) { |
| 1166 ui::MouseWheelEvent mapped_event(*event->AsPointerEvent()); | 1170 ui::MouseWheelEvent mapped_event(*event->AsPointerEvent()); |
| 1167 host->SendEventToProcessor(&mapped_event); | 1171 host->SendEventToProcessor(&mapped_event); |
| 1168 } else { | 1172 } else { |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1822 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1819 this, capture_synchronizer_.get(), window)); | 1823 this, capture_synchronizer_.get(), window)); |
| 1820 } | 1824 } |
| 1821 | 1825 |
| 1822 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1826 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1823 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1827 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1824 this, focus_synchronizer_.get(), window)); | 1828 this, focus_synchronizer_.get(), window)); |
| 1825 } | 1829 } |
| 1826 | 1830 |
| 1827 } // namespace aura | 1831 } // namespace aura |
| OLD | NEW |