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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "services/shell/public/cpp/connector.h" | 15 #include "services/shell/public/cpp/connector.h" |
16 #include "services/ui/common/util.h" | 16 #include "services/ui/common/util.h" |
17 #include "services/ui/public/cpp/input_event_handler.h" | 17 #include "services/ui/public/cpp/input_event_handler.h" |
18 #include "services/ui/public/cpp/lib/in_flight_change.h" | 18 #include "services/ui/public/cpp/lib/in_flight_change.h" |
19 #include "services/ui/public/cpp/lib/window_private.h" | 19 #include "services/ui/public/cpp/lib/window_private.h" |
20 #include "services/ui/public/cpp/window_manager_delegate.h" | 20 #include "services/ui/public/cpp/window_manager_delegate.h" |
21 #include "services/ui/public/cpp/window_observer.h" | 21 #include "services/ui/public/cpp/window_observer.h" |
22 #include "services/ui/public/cpp/window_tracker.h" | 22 #include "services/ui/public/cpp/window_tracker.h" |
23 #include "services/ui/public/cpp/window_tree_client_delegate.h" | 23 #include "services/ui/public/cpp/window_tree_client_delegate.h" |
24 #include "services/ui/public/cpp/window_tree_client_observer.h" | 24 #include "services/ui/public/cpp/window_tree_client_observer.h" |
25 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" | 25 #include "services/ui/public/interfaces/window_manager_window_tree_factory.mojom
.h" |
26 #include "ui/display/mojo/display_type_converters.h" | |
27 #include "ui/events/event.h" | 26 #include "ui/events/event.h" |
28 #include "ui/gfx/geometry/insets.h" | 27 #include "ui/gfx/geometry/insets.h" |
29 #include "ui/gfx/geometry/size.h" | 28 #include "ui/gfx/geometry/size.h" |
30 | 29 |
31 namespace ui { | 30 namespace ui { |
32 | 31 |
33 void DeleteWindowTreeClient(WindowTreeClient* client) { delete client; } | 32 void DeleteWindowTreeClient(WindowTreeClient* client) { delete client; } |
34 | 33 |
35 Id MakeTransportId(ClientSpecificId client_id, ClientSpecificId local_id) { | 34 Id MakeTransportId(ClientSpecificId client_id, ClientSpecificId local_id) { |
36 return (client_id << 16) | local_id; | 35 return (client_id << 16) | local_id; |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 return; | 1078 return; |
1080 | 1079 |
1081 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), | 1080 FOR_EACH_OBSERVER(WindowObserver, *WindowPrivate(window).observers(), |
1082 OnRequestClose(window)); | 1081 OnRequestClose(window)); |
1083 } | 1082 } |
1084 | 1083 |
1085 void WindowTreeClient::OnConnect(ClientSpecificId client_id) { | 1084 void WindowTreeClient::OnConnect(ClientSpecificId client_id) { |
1086 client_id_ = client_id; | 1085 client_id_ = client_id; |
1087 } | 1086 } |
1088 | 1087 |
1089 void WindowTreeClient::WmNewDisplayAdded(mojom::DisplayPtr display, | 1088 void WindowTreeClient::WmNewDisplayAdded(const display::Display& display, |
1090 mojom::WindowDataPtr root_data, | 1089 mojom::WindowDataPtr root_data, |
1091 bool parent_drawn) { | 1090 bool parent_drawn) { |
1092 WmNewDisplayAddedImpl(display.To<display::Display>(), std::move(root_data), | 1091 WmNewDisplayAddedImpl(display, std::move(root_data), parent_drawn); |
1093 parent_drawn); | |
1094 } | 1092 } |
1095 | 1093 |
1096 void WindowTreeClient::WmSetBounds(uint32_t change_id, | 1094 void WindowTreeClient::WmSetBounds(uint32_t change_id, |
1097 Id window_id, | 1095 Id window_id, |
1098 const gfx::Rect& transit_bounds) { | 1096 const gfx::Rect& transit_bounds) { |
1099 Window* window = GetWindowByServerId(window_id); | 1097 Window* window = GetWindowByServerId(window_id); |
1100 bool result = false; | 1098 bool result = false; |
1101 if (window) { | 1099 if (window) { |
1102 DCHECK(window_manager_delegate_); | 1100 DCHECK(window_manager_delegate_); |
1103 gfx::Rect bounds = transit_bounds; | 1101 gfx::Rect bounds = transit_bounds; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 Window* window, | 1250 Window* window, |
1253 const gfx::Vector2d& offset, | 1251 const gfx::Vector2d& offset, |
1254 const gfx::Insets& hit_area) { | 1252 const gfx::Insets& hit_area) { |
1255 if (window_manager_internal_client_) { | 1253 if (window_manager_internal_client_) { |
1256 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 1254 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
1257 server_id(window), offset.x(), offset.y(), hit_area); | 1255 server_id(window), offset.x(), offset.y(), hit_area); |
1258 } | 1256 } |
1259 } | 1257 } |
1260 | 1258 |
1261 } // namespace ui | 1259 } // namespace ui |
OLD | NEW |