OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_port_mus.h" | 5 #include "ui/aura/mus/window_port_mus.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "ui/aura/client/aura_constants.h" | 8 #include "ui/aura/client/aura_constants.h" |
9 #include "ui/aura/client/transient_window_client.h" | 9 #include "ui/aura/client/transient_window_client.h" |
10 #include "ui/aura/mus/client_surface_embedder.h" | 10 #include "ui/aura/mus/client_surface_embedder.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void WindowPortMus::SetTextInputState(mojo::TextInputStatePtr state) { | 63 void WindowPortMus::SetTextInputState(mojo::TextInputStatePtr state) { |
64 window_tree_client_->SetWindowTextInputState(this, std::move(state)); | 64 window_tree_client_->SetWindowTextInputState(this, std::move(state)); |
65 } | 65 } |
66 | 66 |
67 void WindowPortMus::SetImeVisibility(bool visible, | 67 void WindowPortMus::SetImeVisibility(bool visible, |
68 mojo::TextInputStatePtr state) { | 68 mojo::TextInputStatePtr state) { |
69 window_tree_client_->SetImeVisibility(this, visible, std::move(state)); | 69 window_tree_client_->SetImeVisibility(this, visible, std::move(state)); |
70 } | 70 } |
71 | 71 |
72 void WindowPortMus::SetPredefinedCursor(ui::mojom::CursorType cursor_id) { | 72 void WindowPortMus::SetCursor(const ui::CursorData& cursor) { |
73 if (cursor_id == predefined_cursor_) | 73 if (cursor_.IsSameAs(cursor)) |
74 return; | 74 return; |
75 | 75 |
76 window_tree_client_->SetPredefinedCursor(this, predefined_cursor_, cursor_id); | 76 window_tree_client_->SetCursor(this, cursor_, cursor); |
77 predefined_cursor_ = cursor_id; | 77 cursor_ = cursor; |
78 } | 78 } |
79 | 79 |
80 void WindowPortMus::SetEventTargetingPolicy( | 80 void WindowPortMus::SetEventTargetingPolicy( |
81 ui::mojom::EventTargetingPolicy policy) { | 81 ui::mojom::EventTargetingPolicy policy) { |
82 window_tree_client_->SetEventTargetingPolicy(this, policy); | 82 window_tree_client_->SetEventTargetingPolicy(this, policy); |
83 } | 83 } |
84 | 84 |
85 void WindowPortMus::SetCanAcceptDrops(bool can_accept_drops) { | 85 void WindowPortMus::SetCanAcceptDrops(bool can_accept_drops) { |
86 window_tree_client_->SetCanAcceptDrops(this, can_accept_drops); | 86 window_tree_client_->SetCanAcceptDrops(this, can_accept_drops); |
87 } | 87 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 if (visible) | 263 if (visible) |
264 window_->Show(); | 264 window_->Show(); |
265 else | 265 else |
266 window_->Hide(); | 266 window_->Hide(); |
267 } | 267 } |
268 | 268 |
269 void WindowPortMus::SetOpacityFromServer(float opacity) { | 269 void WindowPortMus::SetOpacityFromServer(float opacity) { |
270 window_->layer()->SetOpacity(opacity); | 270 window_->layer()->SetOpacity(opacity); |
271 } | 271 } |
272 | 272 |
273 void WindowPortMus::SetPredefinedCursorFromServer( | 273 void WindowPortMus::SetCursorFromServer(const ui::CursorData& cursor) { |
274 ui::mojom::CursorType cursor) { | |
275 // As this does nothing more than set the cursor we don't need to use | 274 // As this does nothing more than set the cursor we don't need to use |
276 // ServerChange. | 275 // ServerChange. |
277 predefined_cursor_ = cursor; | 276 cursor_ = cursor; |
278 } | 277 } |
279 | 278 |
280 void WindowPortMus::SetPropertyFromServer( | 279 void WindowPortMus::SetPropertyFromServer( |
281 const std::string& property_name, | 280 const std::string& property_name, |
282 const std::vector<uint8_t>* property_data) { | 281 const std::vector<uint8_t>* property_data) { |
283 ServerChangeData data; | 282 ServerChangeData data; |
284 data.property_name = property_name; | 283 data.property_name = property_name; |
285 ScopedServerChange change(this, ServerChangeType::PROPERTY, data); | 284 ScopedServerChange change(this, ServerChangeType::PROPERTY, data); |
286 GetPropertyConverter()->SetPropertyFromTransportValue(window_, property_name, | 285 GetPropertyConverter()->SetPropertyFromTransportValue(window_, property_name, |
287 property_data); | 286 property_data); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 if (!client_surface_embedder_) { | 543 if (!client_surface_embedder_) { |
545 client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>( | 544 client_surface_embedder_ = base::MakeUnique<ClientSurfaceEmbedder>( |
546 window_, window_tree_client_->normal_client_area_insets_); | 545 window_, window_tree_client_->normal_client_area_insets_); |
547 } | 546 } |
548 | 547 |
549 client_surface_embedder_->SetPrimarySurfaceInfo(primary_surface_info_); | 548 client_surface_embedder_->SetPrimarySurfaceInfo(primary_surface_info_); |
550 client_surface_embedder_->SetFallbackSurfaceInfo(fallback_surface_info_); | 549 client_surface_embedder_->SetFallbackSurfaceInfo(fallback_surface_info_); |
551 } | 550 } |
552 | 551 |
553 } // namespace aura | 552 } // namespace aura |
OLD | NEW |