Index: ui/views/mus/window_manager_connection.cc |
diff --git a/ui/views/mus/window_manager_connection.cc b/ui/views/mus/window_manager_connection.cc |
index f52771ad4d01ac89d58e7b4cfd6f50dcf773cec5..4e7e4e44b8ccf8c12d01518c49a4a5c0dfb119cc 100644 |
--- a/ui/views/mus/window_manager_connection.cc |
+++ b/ui/views/mus/window_manager_connection.cc |
@@ -142,9 +142,19 @@ void WindowManagerConnection::OnEmbed(mus::Window* root) {} |
void WindowManagerConnection::OnConnectionLost( |
mus::WindowTreeConnection* connection) {} |
-void WindowManagerConnection::OnEventObserved(const ui::Event& event) { |
+void WindowManagerConnection::OnEventObserved(const ui::Event& event, |
+ mus::Window* target) { |
if (!event.IsLocatedEvent()) |
return; |
+ Widget* target_widget = nullptr; |
+ if (target) { |
+ mus::Window* root = target->GetRoot(); |
+ target_widget = NativeWidgetMus::GetWidgetForWindow(root); |
+ LOG(ERROR) << "JAMES target_widget " << target_widget->GetName(); |
+ } else { |
+ LOG(ERROR) << "JAMES no target"; |
+ } |
+ |
// The mojo input events type converter uses the event root_location field |
// to store screen coordinates. Screen coordinates really should be returned |
// separately. See http://crbug.com/608547 |
@@ -152,11 +162,11 @@ void WindowManagerConnection::OnEventObserved(const ui::Event& event) { |
if (event.type() == ui::ET_MOUSE_PRESSED) { |
FOR_EACH_OBSERVER( |
PointerWatcher, pointer_watchers_, |
- OnMousePressed(*event.AsMouseEvent(), location_in_screen)); |
+ OnMousePressed(*event.AsMouseEvent(), location_in_screen, target_widget)); |
} else if (event.type() == ui::ET_TOUCH_PRESSED) { |
FOR_EACH_OBSERVER( |
PointerWatcher, pointer_watchers_, |
- OnTouchPressed(*event.AsTouchEvent(), location_in_screen)); |
+ OnTouchPressed(*event.AsTouchEvent(), location_in_screen, target_widget)); |
} |
} |