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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 // |window_| is null if a property is set on the aura::Window before | 423 // |window_| is null if a property is set on the aura::Window before |
424 // Window::Init() is called. It's safe to ignore the change in this case as | 424 // Window::Init() is called. It's safe to ignore the change in this case as |
425 // once Window::Init() is called the Window is queried for the current set of | 425 // once Window::Init() is called the Window is queried for the current set of |
426 // properties. | 426 // properties. |
427 if (!window_) | 427 if (!window_) |
428 return nullptr; | 428 return nullptr; |
429 | 429 |
430 return window_tree_client_->OnWindowMusWillChangeProperty(this, key); | 430 return window_tree_client_->OnWindowMusWillChangeProperty(this, key); |
431 } | 431 } |
432 | 432 |
433 void WindowPortMus::OnPropertyChanged( | 433 void WindowPortMus::OnPropertyChanged(const void* key, |
434 const void* key, | 434 int64_t old_value, |
435 std::unique_ptr<ui::PropertyData> data) { | 435 std::unique_ptr<ui::PropertyData> data) { |
436 // See comment in OnWillChangeProperty() as to why |window_| may be null. | 436 // See comment in OnWillChangeProperty() as to why |window_| may be null. |
437 if (!window_) | 437 if (!window_) |
438 return; | 438 return; |
439 | 439 |
440 ServerChangeData change_data; | 440 ServerChangeData change_data; |
441 change_data.property_name = | 441 change_data.property_name = |
442 GetPropertyConverter()->GetTransportNameForPropertyKey(key); | 442 GetPropertyConverter()->GetTransportNameForPropertyKey(key); |
443 // TODO(sky): investigate to see if we need to compare data. In particular do | 443 // TODO(sky): investigate to see if we need to compare data. In particular do |
444 // we ever have a case where changing a property cascades into changing the | 444 // we ever have a case where changing a property cascades into changing the |
445 // same property? | 445 // same property? |
446 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) | 446 if (!RemoveChangeByTypeAndData(ServerChangeType::PROPERTY, change_data)) |
447 window_tree_client_->OnWindowMusPropertyChanged(this, key, std::move(data)); | 447 window_tree_client_->OnWindowMusPropertyChanged(this, key, old_value, |
| 448 std::move(data)); |
448 } | 449 } |
449 | 450 |
450 } // namespace aura | 451 } // namespace aura |
OLD | NEW |