| Index: components/mus/public/cpp/lib/window_tree_client.cc
|
| diff --git a/components/mus/public/cpp/lib/window_tree_client.cc b/components/mus/public/cpp/lib/window_tree_client.cc
|
| index 7a43101ff6a809ad755b710c8bb4739fd90096c1..362595876fcf31d1089f7e8ba1a071655923e8b4 100644
|
| --- a/components/mus/public/cpp/lib/window_tree_client.cc
|
| +++ b/components/mus/public/cpp/lib/window_tree_client.cc
|
| @@ -30,6 +30,8 @@
|
|
|
| namespace mus {
|
|
|
| +namespace {
|
| +
|
| void DeleteWindowTreeClient(WindowTreeClient* client) { delete client; }
|
|
|
| Id MakeTransportId(ClientSpecificId client_id, ClientSpecificId local_id) {
|
| @@ -61,6 +63,8 @@ Window* AddWindowToClient(WindowTreeClient* client,
|
| return window;
|
| }
|
|
|
| +} // namespace
|
| +
|
| Window* BuildWindowTree(WindowTreeClient* client,
|
| const mojo::Array<mojom::WindowDataPtr>& windows,
|
| Window* initial_parent) {
|
| @@ -100,6 +104,7 @@ WindowTreeClient::WindowTreeClient(
|
| tree_(nullptr),
|
| delete_on_no_roots_(!window_manager_delegate),
|
| in_destructor_(false),
|
| + event_handler_binding_(this),
|
| weak_factory_(this) {
|
| // Allow for a null request in tests.
|
| if (request.is_pending())
|
| @@ -1003,6 +1008,17 @@ void WindowTreeClient::OnWindowPredefinedCursorChanged(
|
| WindowPrivate(window).LocalSetPredefinedCursor(cursor);
|
| }
|
|
|
| +void X() {
|
| + LOG(ERROR) << "FFFFFFFFFFFFFFFFUCK";
|
| +}
|
| +
|
| +void WindowTreeClient::RequestInputEventHandler(
|
| + mojom::InputEventHandlerRequest request) {
|
| + LOG(ERROR) << "Yes";
|
| + event_handler_binding_.Bind(std::move(request));
|
| + event_handler_binding_.set_connection_error_handler(base::Bind(&X));
|
| +}
|
| +
|
| void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) {
|
| std::unique_ptr<InFlightChange> change(std::move(in_flight_map_[change_id]));
|
| in_flight_map_.erase(change_id);
|
| @@ -1178,4 +1194,18 @@ void WindowTreeClient::SetUnderlaySurfaceOffsetAndExtendedHitArea(
|
| }
|
| }
|
|
|
| +void WindowTreeClient::OnInputEvent(uint32_t window_id,
|
| + std::unique_ptr<ui::Event> event,
|
| + const OnInputEventCallback& callback) {
|
| + Window* window = GetWindowByServerId(window_id); // May be null.
|
| + LOG(ERROR) << "X: " << event->name() << " " << window << " " << window_id
|
| + << " " << windows_.size();
|
| + if (!window && !windows_.empty())
|
| + window = windows_.begin()->second;
|
| + if (window && window->input_event_handler_) {
|
| + window->input_event_handler_->OnWindowInputEvent(window, *event, nullptr);
|
| + }
|
| + callback.Run(true);
|
| +}
|
| +
|
| } // namespace mus
|
|
|