| 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 // Only the owner of the window can change the bounds. | 1578 // Only the owner of the window can change the bounds. |
| 1579 bool success = window && access_policy_->CanSetCursorProperties(window); | 1579 bool success = window && access_policy_->CanSetCursorProperties(window); |
| 1580 if (success) { | 1580 if (success) { |
| 1581 Operation op(this, window_server_, | 1581 Operation op(this, window_server_, |
| 1582 OperationType::SET_WINDOW_PREDEFINED_CURSOR); | 1582 OperationType::SET_WINDOW_PREDEFINED_CURSOR); |
| 1583 window->SetPredefinedCursor(cursor_id); | 1583 window->SetPredefinedCursor(cursor_id); |
| 1584 } | 1584 } |
| 1585 client()->OnChangeCompleted(change_id, success); | 1585 client()->OnChangeCompleted(change_id, success); |
| 1586 } | 1586 } |
| 1587 | 1587 |
| 1588 void WindowTree::DeactivateWindow(Id window_id) { |
| 1589 ServerWindow* window = |
| 1590 GetWindowByClientId(ClientWindowId(window_id)); |
| 1591 if (!window) { |
| 1592 DVLOG(1) << "DeactivateWindow failed (invalid id)"; |
| 1593 return; |
| 1594 } |
| 1595 |
| 1596 WindowManagerDisplayRoot* display_root = GetWindowManagerDisplayRoot(window); |
| 1597 if (!display_root) { |
| 1598 // The window isn't parented. There's nothing to do. |
| 1599 DVLOG(1) << "DeactivateWindow failed (window unparented)"; |
| 1600 return; |
| 1601 } |
| 1602 |
| 1603 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); |
| 1604 wm_tree->window_manager_internal_->WmDeactivateWindow( |
| 1605 wm_tree->ClientWindowIdForWindow(window).id); |
| 1606 } |
| 1607 |
| 1588 void WindowTree::GetWindowManagerClient( | 1608 void WindowTree::GetWindowManagerClient( |
| 1589 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) { | 1609 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) { |
| 1590 if (!access_policy_->CanSetWindowManager() || !window_manager_internal_ || | 1610 if (!access_policy_->CanSetWindowManager() || !window_manager_internal_ || |
| 1591 window_manager_internal_client_binding_) { | 1611 window_manager_internal_client_binding_) { |
| 1592 return; | 1612 return; |
| 1593 } | 1613 } |
| 1594 window_manager_internal_client_binding_.reset( | 1614 window_manager_internal_client_binding_.reset( |
| 1595 new mojo::AssociatedBinding<mojom::WindowManagerClient>( | 1615 new mojo::AssociatedBinding<mojom::WindowManagerClient>( |
| 1596 this, std::move(internal))); | 1616 this, std::move(internal))); |
| 1597 } | 1617 } |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2030 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2011 effect_bitmask, callback); | 2031 effect_bitmask, callback); |
| 2012 } | 2032 } |
| 2013 | 2033 |
| 2014 void WindowTree::PerformOnDragDropDone() { | 2034 void WindowTree::PerformOnDragDropDone() { |
| 2015 client()->OnDragDropDone(); | 2035 client()->OnDragDropDone(); |
| 2016 } | 2036 } |
| 2017 | 2037 |
| 2018 } // namespace ws | 2038 } // namespace ws |
| 2019 } // namespace ui | 2039 } // namespace ui |
| OLD | NEW |