| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 tree_ptr_->GetCursorLocationMemory( | 519 tree_ptr_->GetCursorLocationMemory( |
| 520 base::Bind(&WindowTreeClient::OnReceivedCursorLocationMemory, | 520 base::Bind(&WindowTreeClient::OnReceivedCursorLocationMemory, |
| 521 weak_factory_.GetWeakPtr())); | 521 weak_factory_.GetWeakPtr())); |
| 522 | 522 |
| 523 tree_ptr_.set_connection_error_handler(base::Bind( | 523 tree_ptr_.set_connection_error_handler(base::Bind( |
| 524 &WindowTreeClient::OnConnectionLost, weak_factory_.GetWeakPtr())); | 524 &WindowTreeClient::OnConnectionLost, weak_factory_.GetWeakPtr())); |
| 525 | 525 |
| 526 if (window_manager_delegate_) { | 526 if (window_manager_delegate_) { |
| 527 tree_ptr_->GetWindowManagerClient( | 527 tree_ptr_->GetWindowManagerClient( |
| 528 MakeRequest(&window_manager_internal_client_)); | 528 MakeRequest(&window_manager_internal_client_)); |
| 529 window_manager_client_ = window_manager_internal_client_.get(); |
| 529 } | 530 } |
| 530 } | 531 } |
| 531 | 532 |
| 532 void WindowTreeClient::WindowTreeConnectionEstablished( | 533 void WindowTreeClient::WindowTreeConnectionEstablished( |
| 533 ui::mojom::WindowTree* window_tree) { | 534 ui::mojom::WindowTree* window_tree) { |
| 534 tree_ = window_tree; | 535 tree_ = window_tree; |
| 535 | 536 |
| 536 drag_drop_controller_ = base::MakeUnique<DragDropControllerMus>(this, tree_); | 537 drag_drop_controller_ = base::MakeUnique<DragDropControllerMus>(this, tree_); |
| 537 capture_synchronizer_ = base::MakeUnique<CaptureSynchronizer>(this, tree_); | 538 capture_synchronizer_ = base::MakeUnique<CaptureSynchronizer>(this, tree_); |
| 538 focus_synchronizer_ = base::MakeUnique<FocusSynchronizer>(this, tree_); | 539 focus_synchronizer_ = base::MakeUnique<FocusSynchronizer>(this, tree_); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 // As |window| is a root, changes to its bounds are ignored (it's assumed | 728 // As |window| is a root, changes to its bounds are ignored (it's assumed |
| 728 // bounds changes are routed through OnWindowTreeHostBoundsWillChange()). | 729 // bounds changes are routed through OnWindowTreeHostBoundsWillChange()). |
| 729 // But the display is created with an initial bounds, and we need to push | 730 // But the display is created with an initial bounds, and we need to push |
| 730 // that to the server. | 731 // that to the server. |
| 731 DCHECK(kRootWindowBoundsChangesAreIgnored); | 732 DCHECK(kRootWindowBoundsChangesAreIgnored); |
| 732 ScheduleInFlightBoundsChange( | 733 ScheduleInFlightBoundsChange( |
| 733 window, gfx::Rect(), | 734 window, gfx::Rect(), |
| 734 gfx::Rect( | 735 gfx::Rect( |
| 735 display_init_params->viewport_metrics.bounds_in_pixels.size())); | 736 display_init_params->viewport_metrics.bounds_in_pixels.size())); |
| 736 | 737 |
| 737 // Tests may not config |window_manager_internal_client_|. | 738 if (window_manager_client_) { |
| 738 if (window_manager_internal_client_) { | 739 window_manager_client_->SetDisplayRoot( |
| 739 window_manager_internal_client_->SetDisplayRoot( | |
| 740 display, display_init_params->viewport_metrics.Clone(), | 740 display, display_init_params->viewport_metrics.Clone(), |
| 741 display_init_params->is_primary_display, window->server_id(), | 741 display_init_params->is_primary_display, window->server_id(), |
| 742 base::Bind(&WindowTreeClient::OnSetDisplayRootDone, | 742 base::Bind(&WindowTreeClient::OnSetDisplayRootDone, |
| 743 base::Unretained(this), window->server_id())); | 743 base::Unretained(this), window->server_id())); |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 | 747 |
| 748 void WindowTreeClient::OnWindowMusDestroyed(WindowMus* window, Origin origin) { | 748 void WindowTreeClient::OnWindowMusDestroyed(WindowMus* window, Origin origin) { |
| 749 if (focus_synchronizer_->focused_window() == window) | 749 if (focus_synchronizer_->focused_window() == window) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 | 885 |
| 886 const uint32_t change_id = | 886 const uint32_t change_id = |
| 887 ScheduleInFlightChange(base::MakeUnique<InFlightPropertyChange>( | 887 ScheduleInFlightChange(base::MakeUnique<InFlightPropertyChange>( |
| 888 window, transport_name, std::move(data_mus->transport_value))); | 888 window, transport_name, std::move(data_mus->transport_value))); |
| 889 tree_->SetWindowProperty(change_id, window->server_id(), transport_name, | 889 tree_->SetWindowProperty(change_id, window->server_id(), transport_name, |
| 890 transport_value_mojo); | 890 transport_value_mojo); |
| 891 } | 891 } |
| 892 | 892 |
| 893 void WindowTreeClient::OnWmMoveLoopCompleted(uint32_t change_id, | 893 void WindowTreeClient::OnWmMoveLoopCompleted(uint32_t change_id, |
| 894 bool completed) { | 894 bool completed) { |
| 895 if (window_manager_internal_client_) | 895 if (window_manager_client_) |
| 896 window_manager_internal_client_->WmResponse(change_id, completed); | 896 window_manager_client_->WmResponse(change_id, completed); |
| 897 | 897 |
| 898 if (change_id == current_wm_move_loop_change_) { | 898 if (change_id == current_wm_move_loop_change_) { |
| 899 current_wm_move_loop_change_ = 0; | 899 current_wm_move_loop_change_ = 0; |
| 900 current_wm_move_loop_window_id_ = 0; | 900 current_wm_move_loop_window_id_ = 0; |
| 901 } | 901 } |
| 902 } | 902 } |
| 903 | 903 |
| 904 std::set<Window*> WindowTreeClient::GetRoots() { | 904 std::set<Window*> WindowTreeClient::GetRoots() { |
| 905 std::set<Window*> roots; | 905 std::set<Window*> roots; |
| 906 for (WindowMus* window : roots_) | 906 for (WindowMus* window : roots_) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 const cc::FrameSinkId& frame_sink_id, | 979 const cc::FrameSinkId& frame_sink_id, |
| 980 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { | 980 const base::Optional<cc::LocalSurfaceId>& local_surface_id) { |
| 981 DCHECK(!tree_ptr_); | 981 DCHECK(!tree_ptr_); |
| 982 tree_ptr_ = std::move(tree); | 982 tree_ptr_ = std::move(tree); |
| 983 | 983 |
| 984 is_from_embed_ = true; | 984 is_from_embed_ = true; |
| 985 | 985 |
| 986 if (window_manager_delegate_) { | 986 if (window_manager_delegate_) { |
| 987 tree_ptr_->GetWindowManagerClient( | 987 tree_ptr_->GetWindowManagerClient( |
| 988 MakeRequest(&window_manager_internal_client_)); | 988 MakeRequest(&window_manager_internal_client_)); |
| 989 window_manager_client_ = window_manager_internal_client_.get(); |
| 989 } | 990 } |
| 990 | 991 |
| 991 OnEmbedImpl(tree_ptr_.get(), client_id, std::move(root_data), display_id, | 992 OnEmbedImpl(tree_ptr_.get(), client_id, std::move(root_data), display_id, |
| 992 focused_window_id, drawn, frame_sink_id, local_surface_id); | 993 focused_window_id, drawn, frame_sink_id, local_surface_id); |
| 993 } | 994 } |
| 994 | 995 |
| 995 void WindowTreeClient::OnEmbeddedAppDisconnected(Id window_id) { | 996 void WindowTreeClient::OnEmbeddedAppDisconnected(Id window_id) { |
| 996 WindowMus* window = GetWindowByServerId(window_id); | 997 WindowMus* window = GetWindowByServerId(window_id); |
| 997 if (window) | 998 if (window) |
| 998 window->NotifyEmbeddedAppDisconnected(); | 999 window->NotifyEmbeddedAppDisconnected(); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 if (window) { | 1529 if (window) { |
| 1529 float device_scale_factor = ScaleFactorForDisplay(window->GetWindow()); | 1530 float device_scale_factor = ScaleFactorForDisplay(window->GetWindow()); |
| 1530 DCHECK(window_manager_delegate_); | 1531 DCHECK(window_manager_delegate_); |
| 1531 gfx::Rect transit_bounds_in_dip = | 1532 gfx::Rect transit_bounds_in_dip = |
| 1532 gfx::ConvertRectToDIP(device_scale_factor, transit_bounds_in_pixels); | 1533 gfx::ConvertRectToDIP(device_scale_factor, transit_bounds_in_pixels); |
| 1533 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), | 1534 window_manager_delegate_->OnWmSetBounds(window->GetWindow(), |
| 1534 transit_bounds_in_dip); | 1535 transit_bounds_in_dip); |
| 1535 } else { | 1536 } else { |
| 1536 DVLOG(1) << "Unknown window passed to WmSetBounds()."; | 1537 DVLOG(1) << "Unknown window passed to WmSetBounds()."; |
| 1537 } | 1538 } |
| 1538 if (window_manager_internal_client_) | 1539 if (window_manager_client_) |
| 1539 window_manager_internal_client_->WmSetBoundsResponse(change_id); | 1540 window_manager_client_->WmSetBoundsResponse(change_id); |
| 1540 } | 1541 } |
| 1541 | 1542 |
| 1542 void WindowTreeClient::WmSetProperty( | 1543 void WindowTreeClient::WmSetProperty( |
| 1543 uint32_t change_id, | 1544 uint32_t change_id, |
| 1544 Id window_id, | 1545 Id window_id, |
| 1545 const std::string& name, | 1546 const std::string& name, |
| 1546 const base::Optional<std::vector<uint8_t>>& transit_data) { | 1547 const base::Optional<std::vector<uint8_t>>& transit_data) { |
| 1547 WindowMus* window = GetWindowByServerId(window_id); | 1548 WindowMus* window = GetWindowByServerId(window_id); |
| 1548 bool result = false; | 1549 bool result = false; |
| 1549 if (window) { | 1550 if (window) { |
| 1550 DCHECK(window_manager_delegate_); | 1551 DCHECK(window_manager_delegate_); |
| 1551 std::unique_ptr<std::vector<uint8_t>> data; | 1552 std::unique_ptr<std::vector<uint8_t>> data; |
| 1552 if (transit_data.has_value()) | 1553 if (transit_data.has_value()) |
| 1553 data.reset(new std::vector<uint8_t>(transit_data.value())); | 1554 data.reset(new std::vector<uint8_t>(transit_data.value())); |
| 1554 | 1555 |
| 1555 result = window_manager_delegate_->OnWmSetProperty(window->GetWindow(), | 1556 result = window_manager_delegate_->OnWmSetProperty(window->GetWindow(), |
| 1556 name, &data); | 1557 name, &data); |
| 1557 if (result) { | 1558 if (result) { |
| 1558 delegate_->GetPropertyConverter()->SetPropertyFromTransportValue( | 1559 delegate_->GetPropertyConverter()->SetPropertyFromTransportValue( |
| 1559 window->GetWindow(), name, data.get()); | 1560 window->GetWindow(), name, data.get()); |
| 1560 } | 1561 } |
| 1561 } | 1562 } |
| 1562 if (window_manager_internal_client_) | 1563 if (window_manager_client_) |
| 1563 window_manager_internal_client_->WmResponse(change_id, result); | 1564 window_manager_client_->WmResponse(change_id, result); |
| 1564 } | 1565 } |
| 1565 | 1566 |
| 1566 void WindowTreeClient::WmSetModalType(Id window_id, ui::ModalType type) { | 1567 void WindowTreeClient::WmSetModalType(Id window_id, ui::ModalType type) { |
| 1567 WindowMus* window = GetWindowByServerId(window_id); | 1568 WindowMus* window = GetWindowByServerId(window_id); |
| 1568 if (window) | 1569 if (window) |
| 1569 window_manager_delegate_->OnWmSetModalType(window->GetWindow(), type); | 1570 window_manager_delegate_->OnWmSetModalType(window->GetWindow(), type); |
| 1570 } | 1571 } |
| 1571 | 1572 |
| 1572 void WindowTreeClient::WmSetCanFocus(Id window_id, bool can_focus) { | 1573 void WindowTreeClient::WmSetCanFocus(Id window_id, bool can_focus) { |
| 1573 WindowMus* window = GetWindowByServerId(window_id); | 1574 WindowMus* window = GetWindowByServerId(window_id); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1586 auto type_iter = | 1587 auto type_iter = |
| 1587 properties.find(ui::mojom::WindowManager::kWindowType_InitProperty); | 1588 properties.find(ui::mojom::WindowManager::kWindowType_InitProperty); |
| 1588 if (type_iter != properties.end()) { | 1589 if (type_iter != properties.end()) { |
| 1589 // TODO: validation! http://crbug.com/654924. | 1590 // TODO: validation! http://crbug.com/654924. |
| 1590 window_type = static_cast<ui::mojom::WindowType>( | 1591 window_type = static_cast<ui::mojom::WindowType>( |
| 1591 mojo::ConvertTo<int32_t>(type_iter->second)); | 1592 mojo::ConvertTo<int32_t>(type_iter->second)); |
| 1592 } | 1593 } |
| 1593 Window* window = window_manager_delegate_->OnWmCreateTopLevelWindow( | 1594 Window* window = window_manager_delegate_->OnWmCreateTopLevelWindow( |
| 1594 window_type, &properties); | 1595 window_type, &properties); |
| 1595 if (!window) { | 1596 if (!window) { |
| 1596 window_manager_internal_client_->OnWmCreatedTopLevelWindow( | 1597 window_manager_client_->OnWmCreatedTopLevelWindow(change_id, |
| 1597 change_id, kInvalidServerId); | 1598 kInvalidServerId); |
| 1598 return; | 1599 return; |
| 1599 } | 1600 } |
| 1600 embedded_windows_[requesting_client_id].insert(window); | 1601 embedded_windows_[requesting_client_id].insert(window); |
| 1601 if (window_manager_internal_client_) { | 1602 if (window_manager_client_) { |
| 1602 window_manager_internal_client_->OnWmCreatedTopLevelWindow( | 1603 window_manager_client_->OnWmCreatedTopLevelWindow( |
| 1603 change_id, WindowMus::Get(window)->server_id()); | 1604 change_id, WindowMus::Get(window)->server_id()); |
| 1604 } | 1605 } |
| 1605 } | 1606 } |
| 1606 | 1607 |
| 1607 void WindowTreeClient::WmClientJankinessChanged(ClientSpecificId client_id, | 1608 void WindowTreeClient::WmClientJankinessChanged(ClientSpecificId client_id, |
| 1608 bool janky) { | 1609 bool janky) { |
| 1609 if (window_manager_delegate_) { | 1610 if (window_manager_delegate_) { |
| 1610 auto it = embedded_windows_.find(client_id); | 1611 auto it = embedded_windows_.find(client_id); |
| 1611 CHECK(it != embedded_windows_.end()); | 1612 CHECK(it != embedded_windows_.end()); |
| 1612 window_manager_delegate_->OnWmClientJankinessChanged( | 1613 window_manager_delegate_->OnWmClientJankinessChanged( |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 } | 1695 } |
| 1695 | 1696 |
| 1696 void WindowTreeClient::WmStackAbove(uint32_t wm_change_id, Id above_id, | 1697 void WindowTreeClient::WmStackAbove(uint32_t wm_change_id, Id above_id, |
| 1697 Id below_id) { | 1698 Id below_id) { |
| 1698 if (!window_manager_delegate_) | 1699 if (!window_manager_delegate_) |
| 1699 return; | 1700 return; |
| 1700 | 1701 |
| 1701 WindowMus* below_mus = GetWindowByServerId(below_id); | 1702 WindowMus* below_mus = GetWindowByServerId(below_id); |
| 1702 if (!below_mus) { | 1703 if (!below_mus) { |
| 1703 DVLOG(1) << "Attempt to stack at top invalid window " << below_id; | 1704 DVLOG(1) << "Attempt to stack at top invalid window " << below_id; |
| 1704 if (window_manager_internal_client_) | 1705 if (window_manager_client_) |
| 1705 window_manager_internal_client_->WmResponse(wm_change_id, false); | 1706 window_manager_client_->WmResponse(wm_change_id, false); |
| 1706 return; | 1707 return; |
| 1707 } | 1708 } |
| 1708 | 1709 |
| 1709 WindowMus* above_mus = GetWindowByServerId(above_id); | 1710 WindowMus* above_mus = GetWindowByServerId(above_id); |
| 1710 if (!above_mus) { | 1711 if (!above_mus) { |
| 1711 DVLOG(1) << "Attempt to stack at top invalid window " << above_id; | 1712 DVLOG(1) << "Attempt to stack at top invalid window " << above_id; |
| 1712 if (window_manager_internal_client_) | 1713 if (window_manager_client_) |
| 1713 window_manager_internal_client_->WmResponse(wm_change_id, false); | 1714 window_manager_client_->WmResponse(wm_change_id, false); |
| 1714 return; | 1715 return; |
| 1715 } | 1716 } |
| 1716 | 1717 |
| 1717 Window* above = above_mus->GetWindow(); | 1718 Window* above = above_mus->GetWindow(); |
| 1718 Window* below = below_mus->GetWindow(); | 1719 Window* below = below_mus->GetWindow(); |
| 1719 | 1720 |
| 1720 if (above->parent() != below->parent()) { | 1721 if (above->parent() != below->parent()) { |
| 1721 DVLOG(1) << "Windows do not share the same parent"; | 1722 DVLOG(1) << "Windows do not share the same parent"; |
| 1722 if (window_manager_internal_client_) | 1723 if (window_manager_client_) |
| 1723 window_manager_internal_client_->WmResponse(wm_change_id, false); | 1724 window_manager_client_->WmResponse(wm_change_id, false); |
| 1724 return; | 1725 return; |
| 1725 } | 1726 } |
| 1726 | 1727 |
| 1727 above->parent()->StackChildAbove(above, below); | 1728 above->parent()->StackChildAbove(above, below); |
| 1728 | 1729 |
| 1729 if (window_manager_internal_client_) | 1730 if (window_manager_client_) |
| 1730 window_manager_internal_client_->WmResponse(wm_change_id, true); | 1731 window_manager_client_->WmResponse(wm_change_id, true); |
| 1731 } | 1732 } |
| 1732 | 1733 |
| 1733 void WindowTreeClient::WmStackAtTop(uint32_t wm_change_id, uint32_t window_id) { | 1734 void WindowTreeClient::WmStackAtTop(uint32_t wm_change_id, uint32_t window_id) { |
| 1734 if (!window_manager_delegate_) | 1735 if (!window_manager_delegate_) |
| 1735 return; | 1736 return; |
| 1736 | 1737 |
| 1737 WindowMus* window = GetWindowByServerId(window_id); | 1738 WindowMus* window = GetWindowByServerId(window_id); |
| 1738 if (!window) { | 1739 if (!window) { |
| 1739 DVLOG(1) << "Attempt to stack at top invalid window " << window_id; | 1740 DVLOG(1) << "Attempt to stack at top invalid window " << window_id; |
| 1740 if (window_manager_internal_client_) | 1741 if (window_manager_client_) |
| 1741 window_manager_internal_client_->WmResponse(wm_change_id, false); | 1742 window_manager_client_->WmResponse(wm_change_id, false); |
| 1742 return; | 1743 return; |
| 1743 } | 1744 } |
| 1744 | 1745 |
| 1745 Window* parent = window->GetWindow()->parent(); | 1746 Window* parent = window->GetWindow()->parent(); |
| 1746 parent->StackChildAtTop(window->GetWindow()); | 1747 parent->StackChildAtTop(window->GetWindow()); |
| 1747 | 1748 |
| 1748 if (window_manager_internal_client_) | 1749 if (window_manager_client_) |
| 1749 window_manager_internal_client_->WmResponse(wm_change_id, true); | 1750 window_manager_client_->WmResponse(wm_change_id, true); |
| 1750 } | 1751 } |
| 1751 | 1752 |
| 1752 void WindowTreeClient::OnAccelerator(uint32_t ack_id, | 1753 void WindowTreeClient::OnAccelerator(uint32_t ack_id, |
| 1753 uint32_t accelerator_id, | 1754 uint32_t accelerator_id, |
| 1754 std::unique_ptr<ui::Event> event) { | 1755 std::unique_ptr<ui::Event> event) { |
| 1755 DCHECK(event); | 1756 DCHECK(event); |
| 1756 std::unordered_map<std::string, std::vector<uint8_t>> properties; | 1757 std::unordered_map<std::string, std::vector<uint8_t>> properties; |
| 1757 const ui::mojom::EventResult result = window_manager_delegate_->OnAccelerator( | 1758 const ui::mojom::EventResult result = window_manager_delegate_->OnAccelerator( |
| 1758 accelerator_id, *event.get(), &properties); | 1759 accelerator_id, *event.get(), &properties); |
| 1759 if (ack_id && window_manager_internal_client_) | 1760 if (ack_id && window_manager_client_) |
| 1760 window_manager_internal_client_->OnAcceleratorAck(ack_id, result, | 1761 window_manager_client_->OnAcceleratorAck(ack_id, result, properties); |
| 1761 properties); | |
| 1762 } | 1762 } |
| 1763 | 1763 |
| 1764 void WindowTreeClient::SetFrameDecorationValues( | 1764 void WindowTreeClient::SetFrameDecorationValues( |
| 1765 ui::mojom::FrameDecorationValuesPtr values) { | 1765 ui::mojom::FrameDecorationValuesPtr values) { |
| 1766 if (window_manager_internal_client_) { | 1766 if (window_manager_client_) { |
| 1767 normal_client_area_insets_ = values->normal_client_area_insets; | 1767 normal_client_area_insets_ = values->normal_client_area_insets; |
| 1768 window_manager_internal_client_->WmSetFrameDecorationValues( | 1768 window_manager_client_->WmSetFrameDecorationValues(std::move(values)); |
| 1769 std::move(values)); | |
| 1770 } | 1769 } |
| 1771 } | 1770 } |
| 1772 | 1771 |
| 1773 void WindowTreeClient::SetNonClientCursor(Window* window, | 1772 void WindowTreeClient::SetNonClientCursor(Window* window, |
| 1774 ui::mojom::CursorType cursor_id) { | 1773 ui::mojom::CursorType cursor_id) { |
| 1775 if (window_manager_internal_client_) { | 1774 if (window_manager_client_) { |
| 1776 window_manager_internal_client_->WmSetNonClientCursor( | 1775 window_manager_client_->WmSetNonClientCursor( |
| 1777 WindowMus::Get(window)->server_id(), cursor_id); | 1776 WindowMus::Get(window)->server_id(), cursor_id); |
| 1778 } | 1777 } |
| 1779 } | 1778 } |
| 1780 | 1779 |
| 1781 void WindowTreeClient::AddAccelerators( | 1780 void WindowTreeClient::AddAccelerators( |
| 1782 std::vector<ui::mojom::WmAcceleratorPtr> accelerators, | 1781 std::vector<ui::mojom::WmAcceleratorPtr> accelerators, |
| 1783 const base::Callback<void(bool)>& callback) { | 1782 const base::Callback<void(bool)>& callback) { |
| 1784 if (window_manager_internal_client_) { | 1783 if (window_manager_client_) { |
| 1785 window_manager_internal_client_->AddAccelerators(std::move(accelerators), | 1784 window_manager_client_->AddAccelerators(std::move(accelerators), callback); |
| 1786 callback); | |
| 1787 } | 1785 } |
| 1788 } | 1786 } |
| 1789 | 1787 |
| 1790 void WindowTreeClient::RemoveAccelerator(uint32_t id) { | 1788 void WindowTreeClient::RemoveAccelerator(uint32_t id) { |
| 1791 if (window_manager_internal_client_) { | 1789 if (window_manager_client_) { |
| 1792 window_manager_internal_client_->RemoveAccelerator(id); | 1790 window_manager_client_->RemoveAccelerator(id); |
| 1793 } | 1791 } |
| 1794 } | 1792 } |
| 1795 | 1793 |
| 1796 void WindowTreeClient::AddActivationParent(Window* window) { | 1794 void WindowTreeClient::AddActivationParent(Window* window) { |
| 1797 if (window_manager_internal_client_) { | 1795 if (window_manager_client_) { |
| 1798 window_manager_internal_client_->AddActivationParent( | 1796 window_manager_client_->AddActivationParent( |
| 1799 WindowMus::Get(window)->server_id()); | 1797 WindowMus::Get(window)->server_id()); |
| 1800 } | 1798 } |
| 1801 } | 1799 } |
| 1802 | 1800 |
| 1803 void WindowTreeClient::RemoveActivationParent(Window* window) { | 1801 void WindowTreeClient::RemoveActivationParent(Window* window) { |
| 1804 if (window_manager_internal_client_) { | 1802 if (window_manager_client_) { |
| 1805 window_manager_internal_client_->RemoveActivationParent( | 1803 window_manager_client_->RemoveActivationParent( |
| 1806 WindowMus::Get(window)->server_id()); | 1804 WindowMus::Get(window)->server_id()); |
| 1807 } | 1805 } |
| 1808 } | 1806 } |
| 1809 | 1807 |
| 1810 void WindowTreeClient::ActivateNextWindow() { | 1808 void WindowTreeClient::ActivateNextWindow() { |
| 1811 if (window_manager_internal_client_) | 1809 if (window_manager_client_) |
| 1812 window_manager_internal_client_->ActivateNextWindow(); | 1810 window_manager_client_->ActivateNextWindow(); |
| 1813 } | 1811 } |
| 1814 | 1812 |
| 1815 void WindowTreeClient::SetExtendedHitArea(Window* window, | 1813 void WindowTreeClient::SetExtendedHitArea(Window* window, |
| 1816 const gfx::Insets& hit_area) { | 1814 const gfx::Insets& hit_area) { |
| 1817 if (window_manager_internal_client_) { | 1815 if (window_manager_client_) { |
| 1818 float device_scale_factor = ScaleFactorForDisplay(window); | 1816 float device_scale_factor = ScaleFactorForDisplay(window); |
| 1819 window_manager_internal_client_->SetExtendedHitArea( | 1817 window_manager_client_->SetExtendedHitArea( |
| 1820 WindowMus::Get(window)->server_id(), | 1818 WindowMus::Get(window)->server_id(), |
| 1821 gfx::ConvertInsetsToPixel(device_scale_factor, hit_area)); | 1819 gfx::ConvertInsetsToPixel(device_scale_factor, hit_area)); |
| 1822 } | 1820 } |
| 1823 } | 1821 } |
| 1824 | 1822 |
| 1825 void WindowTreeClient::RequestClose(Window* window) { | 1823 void WindowTreeClient::RequestClose(Window* window) { |
| 1826 DCHECK(window); | 1824 DCHECK(window); |
| 1827 if (window_manager_internal_client_) | 1825 if (window_manager_client_) |
| 1828 window_manager_internal_client_->WmRequestClose( | 1826 window_manager_client_->WmRequestClose(WindowMus::Get(window)->server_id()); |
| 1829 WindowMus::Get(window)->server_id()); | |
| 1830 } | 1827 } |
| 1831 | 1828 |
| 1832 void WindowTreeClient::OnWindowTreeHostBoundsWillChange( | 1829 void WindowTreeClient::OnWindowTreeHostBoundsWillChange( |
| 1833 WindowTreeHostMus* window_tree_host, | 1830 WindowTreeHostMus* window_tree_host, |
| 1834 const gfx::Rect& bounds) { | 1831 const gfx::Rect& bounds) { |
| 1835 ScheduleInFlightBoundsChange(WindowMus::Get(window_tree_host->window()), | 1832 ScheduleInFlightBoundsChange(WindowMus::Get(window_tree_host->window()), |
| 1836 window_tree_host->GetBoundsInPixels(), bounds); | 1833 window_tree_host->GetBoundsInPixels(), bounds); |
| 1837 } | 1834 } |
| 1838 | 1835 |
| 1839 void WindowTreeClient::OnWindowTreeHostClientAreaWillChange( | 1836 void WindowTreeClient::OnWindowTreeHostClientAreaWillChange( |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2031 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( | 2028 return ScheduleInFlightChange(base::MakeUnique<InFlightCaptureChange>( |
| 2032 this, capture_synchronizer_.get(), window)); | 2029 this, capture_synchronizer_.get(), window)); |
| 2033 } | 2030 } |
| 2034 | 2031 |
| 2035 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { | 2032 uint32_t WindowTreeClient::CreateChangeIdForFocus(WindowMus* window) { |
| 2036 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( | 2033 return ScheduleInFlightChange(base::MakeUnique<InFlightFocusChange>( |
| 2037 this, focus_synchronizer_.get(), window)); | 2034 this, focus_synchronizer_.get(), window)); |
| 2038 } | 2035 } |
| 2039 | 2036 |
| 2040 } // namespace aura | 2037 } // namespace aura |
| OLD | NEW |