Chromium Code Reviews| 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 requester_window_id) { | |
|
sky
2017/01/12 00:55:39
window_id
Elliot Glaysher
2017/01/12 23:20:37
Done.
| |
| 1589 ServerWindow* window = | |
| 1590 GetWindowByClientId(ClientWindowId(requester_window_id)); | |
| 1591 if (!window) { | |
| 1592 DVLOG(1) << "ActivateNextWindow received invalid id."; | |
| 1593 return; | |
| 1594 } | |
| 1595 | |
| 1596 WindowManagerDisplayRoot* display_root = | |
|
sky
2017/01/12 00:55:39
Make sure you null check display_root. null happen
Elliot Glaysher
2017/01/12 23:20:37
Done.
| |
| 1597 GetWindowManagerDisplayRoot(window); | |
| 1598 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); | |
| 1599 wm_tree->window_manager_internal_->WmDeactivateWindow( | |
| 1600 wm_tree->ClientWindowIdForWindow(window).id); | |
| 1601 } | |
| 1602 | |
| 1588 void WindowTree::GetWindowManagerClient( | 1603 void WindowTree::GetWindowManagerClient( |
| 1589 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) { | 1604 mojo::AssociatedInterfaceRequest<mojom::WindowManagerClient> internal) { |
| 1590 if (!access_policy_->CanSetWindowManager() || !window_manager_internal_ || | 1605 if (!access_policy_->CanSetWindowManager() || !window_manager_internal_ || |
| 1591 window_manager_internal_client_binding_) { | 1606 window_manager_internal_client_binding_) { |
| 1592 return; | 1607 return; |
| 1593 } | 1608 } |
| 1594 window_manager_internal_client_binding_.reset( | 1609 window_manager_internal_client_binding_.reset( |
| 1595 new mojo::AssociatedBinding<mojom::WindowManagerClient>( | 1610 new mojo::AssociatedBinding<mojom::WindowManagerClient>( |
| 1596 this, std::move(internal))); | 1611 this, std::move(internal))); |
| 1597 } | 1612 } |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2010 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2025 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2011 effect_bitmask, callback); | 2026 effect_bitmask, callback); |
| 2012 } | 2027 } |
| 2013 | 2028 |
| 2014 void WindowTree::PerformOnDragDropDone() { | 2029 void WindowTree::PerformOnDragDropDone() { |
| 2015 client()->OnDragDropDone(); | 2030 client()->OnDragDropDone(); |
| 2016 } | 2031 } |
| 2017 | 2032 |
| 2018 } // namespace ws | 2033 } // namespace ws |
| 2019 } // namespace ui | 2034 } // namespace ui |
| OLD | NEW |