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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 } | 408 } |
409 | 409 |
410 void WindowPortMus::OnDidChangeBounds(const gfx::Rect& old_bounds, | 410 void WindowPortMus::OnDidChangeBounds(const gfx::Rect& old_bounds, |
411 const gfx::Rect& new_bounds) { | 411 const gfx::Rect& new_bounds) { |
412 ServerChangeData change_data; | 412 ServerChangeData change_data; |
413 change_data.bounds_in_dip = new_bounds; | 413 change_data.bounds_in_dip = new_bounds; |
414 if (!RemoveChangeByTypeAndData(ServerChangeType::BOUNDS, change_data)) | 414 if (!RemoveChangeByTypeAndData(ServerChangeType::BOUNDS, change_data)) |
415 window_tree_client_->OnWindowMusBoundsChanged(this, old_bounds, new_bounds); | 415 window_tree_client_->OnWindowMusBoundsChanged(this, old_bounds, new_bounds); |
416 } | 416 } |
417 | 417 |
418 std::unique_ptr<WindowPortPropertyData> WindowPortMus::OnWillChangeProperty( | 418 std::unique_ptr<ui::PropertyData> WindowPortMus::OnWillChangeProperty( |
419 const void* key) { | 419 const void* key) { |
420 return window_tree_client_->OnWindowMusWillChangeProperty(this, key); | 420 return window_tree_client_->OnWindowMusWillChangeProperty(this, key); |
421 } | 421 } |
422 | 422 |
423 void WindowPortMus::OnPropertyChanged( | 423 void WindowPortMus::OnPropertyChanged( |
424 const void* key, | 424 const void* key, |
425 std::unique_ptr<WindowPortPropertyData> data) { | 425 std::unique_ptr<ui::PropertyData> data) { |
426 ServerChangeData change_data; | 426 ServerChangeData change_data; |
427 change_data.property_name = | 427 change_data.property_name = |
428 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 428 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
429 // TODO(sky): investigate to see if we need to compare data. In particular do | 429 // TODO(sky): investigate to see if we need to compare data. In particular do |
430 // we ever have a case where changing a property cascades into changing the | 430 // we ever have a case where changing a property cascades into changing the |
431 // same property? | 431 // same property? |
432 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 432 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
433 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 433 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); |
434 } | 434 } |
435 | 435 |
436 } // namespace aura | 436 } // namespace aura |
OLD | NEW |