| 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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 return; | 781 return; |
| 782 | 782 |
| 783 ClientWindowId client_window_id; | 783 ClientWindowId client_window_id; |
| 784 if (IsWindowKnown(window, &client_window_id)) { | 784 if (IsWindowKnown(window, &client_window_id)) { |
| 785 client()->OnWindowOpacityChanged(client_window_id.id, old_opacity, | 785 client()->OnWindowOpacityChanged(client_window_id.id, old_opacity, |
| 786 new_opacity); | 786 new_opacity); |
| 787 } | 787 } |
| 788 } | 788 } |
| 789 | 789 |
| 790 void WindowTree::ProcessCursorChanged(const ServerWindow* window, | 790 void WindowTree::ProcessCursorChanged(const ServerWindow* window, |
| 791 mojom::Cursor cursor_id, | 791 mojom::CursorType cursor_id, |
| 792 bool originated_change) { | 792 bool originated_change) { |
| 793 if (originated_change) | 793 if (originated_change) |
| 794 return; | 794 return; |
| 795 ClientWindowId client_window_id; | 795 ClientWindowId client_window_id; |
| 796 if (!IsWindowKnown(window, &client_window_id)) | 796 if (!IsWindowKnown(window, &client_window_id)) |
| 797 return; | 797 return; |
| 798 | 798 |
| 799 client()->OnWindowPredefinedCursorChanged(client_window_id.id, cursor_id); | 799 client()->OnWindowPredefinedCursorChanged(client_window_id.id, cursor_id); |
| 800 } | 800 } |
| 801 | 801 |
| (...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 mojom::EventTargetingPolicy policy) { | 1646 mojom::EventTargetingPolicy policy) { |
| 1647 ServerWindow* window = | 1647 ServerWindow* window = |
| 1648 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1648 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1649 // TODO(riajiang): check |event_queue_| is empty for |window|. | 1649 // TODO(riajiang): check |event_queue_| is empty for |window|. |
| 1650 if (window && access_policy_->CanSetEventTargetingPolicy(window)) | 1650 if (window && access_policy_->CanSetEventTargetingPolicy(window)) |
| 1651 window->set_event_targeting_policy(policy); | 1651 window->set_event_targeting_policy(policy); |
| 1652 } | 1652 } |
| 1653 | 1653 |
| 1654 void WindowTree::SetPredefinedCursor(uint32_t change_id, | 1654 void WindowTree::SetPredefinedCursor(uint32_t change_id, |
| 1655 Id transport_window_id, | 1655 Id transport_window_id, |
| 1656 ui::mojom::Cursor cursor_id) { | 1656 ui::mojom::CursorType cursor_id) { |
| 1657 ServerWindow* window = | 1657 ServerWindow* window = |
| 1658 GetWindowByClientId(ClientWindowId(transport_window_id)); | 1658 GetWindowByClientId(ClientWindowId(transport_window_id)); |
| 1659 | 1659 |
| 1660 // Only the owner of the window can change the bounds. | 1660 // Only the owner of the window can change the bounds. |
| 1661 bool success = window && access_policy_->CanSetCursorProperties(window); | 1661 bool success = window && access_policy_->CanSetCursorProperties(window); |
| 1662 if (success) { | 1662 if (success) { |
| 1663 Operation op(this, window_server_, | 1663 Operation op(this, window_server_, |
| 1664 OperationType::SET_WINDOW_PREDEFINED_CURSOR); | 1664 OperationType::SET_WINDOW_PREDEFINED_CURSOR); |
| 1665 window->SetPredefinedCursor(cursor_id); | 1665 window->SetPredefinedCursor(cursor_id); |
| 1666 } | 1666 } |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2080 // TODO(sky): think about what else case means. | 2080 // TODO(sky): think about what else case means. |
| 2081 } | 2081 } |
| 2082 | 2082 |
| 2083 void WindowTree::WmSetFrameDecorationValues( | 2083 void WindowTree::WmSetFrameDecorationValues( |
| 2084 mojom::FrameDecorationValuesPtr values) { | 2084 mojom::FrameDecorationValuesPtr values) { |
| 2085 DCHECK(window_manager_state_); | 2085 DCHECK(window_manager_state_); |
| 2086 window_manager_state_->SetFrameDecorationValues(std::move(values)); | 2086 window_manager_state_->SetFrameDecorationValues(std::move(values)); |
| 2087 } | 2087 } |
| 2088 | 2088 |
| 2089 void WindowTree::WmSetNonClientCursor(uint32_t window_id, | 2089 void WindowTree::WmSetNonClientCursor(uint32_t window_id, |
| 2090 mojom::Cursor cursor_id) { | 2090 mojom::CursorType cursor_id) { |
| 2091 DCHECK(window_manager_state_); | 2091 DCHECK(window_manager_state_); |
| 2092 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id)); | 2092 ServerWindow* window = GetWindowByClientId(ClientWindowId(window_id)); |
| 2093 if (window) { | 2093 if (window) { |
| 2094 window->SetNonClientCursor(cursor_id); | 2094 window->SetNonClientCursor(cursor_id); |
| 2095 } else { | 2095 } else { |
| 2096 DVLOG(1) << "trying to update non-client cursor of invalid window"; | 2096 DVLOG(1) << "trying to update non-client cursor of invalid window"; |
| 2097 } | 2097 } |
| 2098 } | 2098 } |
| 2099 | 2099 |
| 2100 void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id, | 2100 void WindowTree::OnWmCreatedTopLevelWindow(uint32_t change_id, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2272 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2272 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2273 effect_bitmask, callback); | 2273 effect_bitmask, callback); |
| 2274 } | 2274 } |
| 2275 | 2275 |
| 2276 void WindowTree::PerformOnDragDropDone() { | 2276 void WindowTree::PerformOnDragDropDone() { |
| 2277 client()->OnDragDropDone(); | 2277 client()->OnDragDropDone(); |
| 2278 } | 2278 } |
| 2279 | 2279 |
| 2280 } // namespace ws | 2280 } // namespace ws |
| 2281 } // namespace ui | 2281 } // namespace ui |
| OLD | NEW |