| 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 "components/mus/public/cpp/lib/window_tree_client_impl.h" | 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 return; | 861 return; |
| 862 | 862 |
| 863 WindowPrivate(window).LocalSetSharedProperty(name, std::move(new_data)); | 863 WindowPrivate(window).LocalSetSharedProperty(name, std::move(new_data)); |
| 864 } | 864 } |
| 865 | 865 |
| 866 void WindowTreeClientImpl::OnWindowInputEvent(uint32_t event_id, | 866 void WindowTreeClientImpl::OnWindowInputEvent(uint32_t event_id, |
| 867 Id window_id, | 867 Id window_id, |
| 868 mojom::EventPtr event) { | 868 mojom::EventPtr event) { |
| 869 Window* window = GetWindowByServerId(window_id); | 869 Window* window = GetWindowByServerId(window_id); |
| 870 if (!window || !window->input_event_handler_) { | 870 if (!window || !window->input_event_handler_) { |
| 871 tree_->OnWindowInputEventAck(event_id, false); | 871 tree_->OnWindowInputEventAck(event_id, mojom::EventResult::UNHANDLED); |
| 872 return; | 872 return; |
| 873 } | 873 } |
| 874 | 874 |
| 875 scoped_ptr<base::Callback<void(bool)>> ack_callback( | 875 scoped_ptr<base::Callback<void(mojom::EventResult)>> ack_callback( |
| 876 new base::Callback<void(bool)>( | 876 new base::Callback<void(mojom::EventResult)>( |
| 877 base::Bind(&mojom::WindowTree::OnWindowInputEventAck, | 877 base::Bind(&mojom::WindowTree::OnWindowInputEventAck, |
| 878 base::Unretained(tree_), event_id))); | 878 base::Unretained(tree_), event_id))); |
| 879 window->input_event_handler_->OnWindowInputEvent( | 879 window->input_event_handler_->OnWindowInputEvent( |
| 880 window, *event.To<scoped_ptr<ui::Event>>().get(), &ack_callback); | 880 window, *event.To<scoped_ptr<ui::Event>>().get(), &ack_callback); |
| 881 | 881 |
| 882 // The handler did not take ownership of the callback, so we send the ack, | 882 // The handler did not take ownership of the callback, so we send the ack, |
| 883 // marking the event as not consumed. | 883 // marking the event as not consumed. |
| 884 if (ack_callback) | 884 if (ack_callback) |
| 885 ack_callback->Run(false); | 885 ack_callback->Run(mojom::EventResult::UNHANDLED); |
| 886 } | 886 } |
| 887 | 887 |
| 888 void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) { | 888 void WindowTreeClientImpl::OnWindowFocused(Id focused_window_id) { |
| 889 Window* focused_window = GetWindowByServerId(focused_window_id); | 889 Window* focused_window = GetWindowByServerId(focused_window_id); |
| 890 InFlightFocusChange new_change(this, focused_window); | 890 InFlightFocusChange new_change(this, focused_window); |
| 891 if (ApplyServerChangeToExistingInFlightChange(new_change)) | 891 if (ApplyServerChangeToExistingInFlightChange(new_change)) |
| 892 return; | 892 return; |
| 893 | 893 |
| 894 LocalSetFocus(focused_window); | 894 LocalSetFocus(focused_window); |
| 895 } | 895 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 | 1032 |
| 1033 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1033 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1034 Window* window, | 1034 Window* window, |
| 1035 const gfx::Vector2d& offset, | 1035 const gfx::Vector2d& offset, |
| 1036 const gfx::Insets& hit_area) { | 1036 const gfx::Insets& hit_area) { |
| 1037 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1037 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 1038 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area)); | 1038 server_id(window), offset.x(), offset.y(), mojo::Insets::From(hit_area)); |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 } // namespace mus | 1041 } // namespace mus |
| OLD | NEW |