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" |
11 #include "ui/aura/mus/property_converter.h" | 11 #include "ui/aura/mus/property_converter.h" |
12 #include "ui/aura/mus/window_tree_client.h" | 12 #include "ui/aura/mus/window_tree_client.h" |
13 #include "ui/aura/mus/window_tree_client_delegate.h" | 13 #include "ui/aura/mus/window_tree_client_delegate.h" |
14 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
15 #include "ui/aura/window_delegate.h" | 15 #include "ui/aura/window_delegate.h" |
16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
17 #include "ui/aura/window_property.h" | 17 #include "ui/base/class_property.h" |
18 | 18 |
19 namespace aura { | 19 namespace aura { |
20 | 20 |
21 WindowPortMus::WindowMusChangeDataImpl::WindowMusChangeDataImpl() = default; | 21 WindowPortMus::WindowMusChangeDataImpl::WindowMusChangeDataImpl() = default; |
22 | 22 |
23 WindowPortMus::WindowMusChangeDataImpl::~WindowMusChangeDataImpl() = default; | 23 WindowPortMus::WindowMusChangeDataImpl::~WindowMusChangeDataImpl() = default; |
24 | 24 |
25 // static | 25 // static |
26 WindowMus* WindowMus::Get(Window* window) { | 26 WindowMus* WindowMus::Get(Window* window) { |
27 return WindowPortMus::Get(window); | 27 return WindowPortMus::Get(window); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 } | 410 } |
411 | 411 |
412 void WindowPortMus::OnDidChangeBounds(const gfx::Rect& old_bounds, | 412 void WindowPortMus::OnDidChangeBounds(const gfx::Rect& old_bounds, |
413 const gfx::Rect& new_bounds) { | 413 const gfx::Rect& new_bounds) { |
414 ServerChangeData change_data; | 414 ServerChangeData change_data; |
415 change_data.bounds_in_dip = new_bounds; | 415 change_data.bounds_in_dip = new_bounds; |
416 if (!RemoveChangeByTypeAndData(ServerChangeType::BOUNDS, change_data)) | 416 if (!RemoveChangeByTypeAndData(ServerChangeType::BOUNDS, change_data)) |
417 window_tree_client_->OnWindowMusBoundsChanged(this, old_bounds, new_bounds); | 417 window_tree_client_->OnWindowMusBoundsChanged(this, old_bounds, new_bounds); |
418 } | 418 } |
419 | 419 |
420 std::unique_ptr<WindowPortPropertyData> WindowPortMus::OnWillChangeProperty( | 420 std::unique_ptr<ui::PropertyData> WindowPortMus::OnWillChangeProperty( |
421 const void* key) { | 421 const void* key) { |
422 return window_tree_client_->OnWindowMusWillChangeProperty(this, key); | 422 return window_tree_client_->OnWindowMusWillChangeProperty(this, key); |
423 } | 423 } |
424 | 424 |
425 void WindowPortMus::OnPropertyChanged( | 425 void WindowPortMus::OnPropertyChanged( |
426 const void* key, | 426 const void* key, |
427 std::unique_ptr<WindowPortPropertyData> data) { | 427 std::unique_ptr<ui::PropertyData> data) { |
428 ServerChangeData change_data; | 428 ServerChangeData change_data; |
429 change_data.property_name = | 429 change_data.property_name = |
430 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 430 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
431 // TODO(sky): investigate to see if we need to compare data. In particular do | 431 // TODO(sky): investigate to see if we need to compare data. In particular do |
432 // we ever have a case where changing a property cascades into changing the | 432 // we ever have a case where changing a property cascades into changing the |
433 // same property? | 433 // same property? |
434 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 434 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
435 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 435 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); |
436 } | 436 } |
437 | 437 |
438 } // namespace aura | 438 } // namespace aura |
OLD | NEW |