| 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 "ui/aura/mus/window_tree_client.h" | 5 #include "ui/aura/mus/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> |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 drag_drop_controller_->OnPerformDragDropCompleted(action_taken); | 1276 drag_drop_controller_->OnPerformDragDropCompleted(action_taken); |
| 1277 } | 1277 } |
| 1278 } | 1278 } |
| 1279 | 1279 |
| 1280 void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) { | 1280 void WindowTreeClient::OnChangeCompleted(uint32_t change_id, bool success) { |
| 1281 std::unique_ptr<InFlightChange> change(std::move(in_flight_map_[change_id])); | 1281 std::unique_ptr<InFlightChange> change(std::move(in_flight_map_[change_id])); |
| 1282 in_flight_map_.erase(change_id); | 1282 in_flight_map_.erase(change_id); |
| 1283 if (!change) | 1283 if (!change) |
| 1284 return; | 1284 return; |
| 1285 | 1285 |
| 1286 delegate_->OnChangeCompleted(change->change_type(), success); |
| 1287 |
| 1286 if (!success) | 1288 if (!success) |
| 1287 change->ChangeFailed(); | 1289 change->ChangeFailed(); |
| 1288 | 1290 |
| 1289 InFlightChange* next_change = GetOldestInFlightChangeMatching(*change); | 1291 InFlightChange* next_change = GetOldestInFlightChangeMatching(*change); |
| 1290 if (next_change) { | 1292 if (next_change) { |
| 1291 if (!success) | 1293 if (!success) |
| 1292 next_change->SetRevertValueFrom(*change); | 1294 next_change->SetRevertValueFrom(*change); |
| 1293 } else if (!success) { | 1295 } else if (!success) { |
| 1294 change->Revert(); | 1296 change->Revert(); |
| 1295 } | 1297 } |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 tree_->SetHitTestMask(WindowMus::Get(window_tree_host->window())->server_id(), | 1605 tree_->SetHitTestMask(WindowMus::Get(window_tree_host->window())->server_id(), |
| 1604 out_rect); | 1606 out_rect); |
| 1605 } | 1607 } |
| 1606 | 1608 |
| 1607 void WindowTreeClient::OnWindowTreeHostDeactivateWindow( | 1609 void WindowTreeClient::OnWindowTreeHostDeactivateWindow( |
| 1608 WindowTreeHostMus* window_tree_host) { | 1610 WindowTreeHostMus* window_tree_host) { |
| 1609 tree_->DeactivateWindow( | 1611 tree_->DeactivateWindow( |
| 1610 WindowMus::Get(window_tree_host->window())->server_id()); | 1612 WindowMus::Get(window_tree_host->window())->server_id()); |
| 1611 } | 1613 } |
| 1612 | 1614 |
| 1615 void WindowTreeClient::OnWindowTreeHostStackAtTop( |
| 1616 WindowTreeHostMus* window_tree_host) { |
| 1617 WindowMus* window = WindowMus::Get(window_tree_host->window()); |
| 1618 const uint32_t change_id = ScheduleInFlightChange( |
| 1619 base::MakeUnique<CrashInFlightChange>(window, ChangeType::REORDER)); |
| 1620 tree_->StackAtTop(change_id, window->server_id()); |
| 1621 } |
| 1622 |
| 1613 std::unique_ptr<WindowPortMus> WindowTreeClient::CreateWindowPortForTopLevel( | 1623 std::unique_ptr<WindowPortMus> WindowTreeClient::CreateWindowPortForTopLevel( |
| 1614 const std::map<std::string, std::vector<uint8_t>>* properties) { | 1624 const std::map<std::string, std::vector<uint8_t>>* properties) { |
| 1615 std::unique_ptr<WindowPortMus> window_port = | 1625 std::unique_ptr<WindowPortMus> window_port = |
| 1616 base::MakeUnique<WindowPortMus>(this, WindowMusType::TOP_LEVEL); | 1626 base::MakeUnique<WindowPortMus>(this, WindowMusType::TOP_LEVEL); |
| 1617 roots_.insert(window_port.get()); | 1627 roots_.insert(window_port.get()); |
| 1618 | 1628 |
| 1619 window_port->set_server_id(MakeTransportId(client_id_, next_window_id_++)); | 1629 window_port->set_server_id(MakeTransportId(client_id_, next_window_id_++)); |
| 1620 RegisterWindowMus(window_port.get()); | 1630 RegisterWindowMus(window_port.get()); |
| 1621 | 1631 |
| 1622 std::unordered_map<std::string, std::vector<uint8_t>> transport_properties; | 1632 std::unordered_map<std::string, std::vector<uint8_t>> transport_properties; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1717 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 1727 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 1718 this, capture_synchronizer_.get(), window)); | 1728 this, capture_synchronizer_.get(), window)); |
| 1719 } | 1729 } |
| 1720 | 1730 |
| 1721 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 1731 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 1722 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 1732 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 1723 this, focus_synchronizer_.get(), window)); | 1733 this, focus_synchronizer_.get(), window)); |
| 1724 } | 1734 } |
| 1725 | 1735 |
| 1726 } // namespace aura | 1736 } // namespace aura |
| OLD | NEW |