Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Side by Side Diff: ui/aura/mus/window_tree_client.cc

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

Powered by Google App Engine
This is Rietveld 408576698