| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 Display* display = GetDisplay(window); | 545 Display* display = GetDisplay(window); |
| 546 if (display) | 546 if (display) |
| 547 display->AddActivationParent(window); | 547 display->AddActivationParent(window); |
| 548 else | 548 else |
| 549 DVLOG(1) << "AddActivationParent window not associated with display"; | 549 DVLOG(1) << "AddActivationParent window not associated with display"; |
| 550 } else { | 550 } else { |
| 551 DVLOG(1) << "AddActivationParent supplied invalid window id"; | 551 DVLOG(1) << "AddActivationParent supplied invalid window id"; |
| 552 } | 552 } |
| 553 } | 553 } |
| 554 | 554 |
| 555 void WindowTree::OnSetWindowBoundsResponse( |
| 556 uint32_t change_id, |
| 557 const gfx::Rect& bounds, |
| 558 const cc::LocalSurfaceId& local_surface_id) { |
| 559 client()->OnSetWindowBoundsResponse(change_id, bounds, local_surface_id); |
| 560 } |
| 561 |
| 555 void WindowTree::OnChangeCompleted(uint32_t change_id, bool success) { | 562 void WindowTree::OnChangeCompleted(uint32_t change_id, bool success) { |
| 556 client()->OnChangeCompleted(change_id, success); | 563 client()->OnChangeCompleted(change_id, success); |
| 557 } | 564 } |
| 558 | 565 |
| 559 void WindowTree::OnAccelerator(uint32_t accelerator_id, | 566 void WindowTree::OnAccelerator(uint32_t accelerator_id, |
| 560 const ui::Event& event, | 567 const ui::Event& event, |
| 561 bool needs_ack) { | 568 bool needs_ack) { |
| 562 DVLOG(3) << "OnAccelerator client=" << id_; | 569 DVLOG(3) << "OnAccelerator client=" << id_; |
| 563 DCHECK(window_manager_internal_); | 570 DCHECK(window_manager_internal_); |
| 564 if (needs_ack) | 571 if (needs_ack) |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 window_data->parent_id = | 1086 window_data->parent_id = |
| 1080 parent ? ClientWindowIdForWindow(parent).id : ClientWindowId().id; | 1087 parent ? ClientWindowIdForWindow(parent).id : ClientWindowId().id; |
| 1081 window_data->window_id = | 1088 window_data->window_id = |
| 1082 window ? ClientWindowIdForWindow(window).id : ClientWindowId().id; | 1089 window ? ClientWindowIdForWindow(window).id : ClientWindowId().id; |
| 1083 window_data->transient_parent_id = | 1090 window_data->transient_parent_id = |
| 1084 transient_parent ? ClientWindowIdForWindow(transient_parent).id | 1091 transient_parent ? ClientWindowIdForWindow(transient_parent).id |
| 1085 : ClientWindowId().id; | 1092 : ClientWindowId().id; |
| 1086 window_data->bounds = window->bounds(); | 1093 window_data->bounds = window->bounds(); |
| 1087 window_data->properties = mojo::MapToUnorderedMap(window->properties()); | 1094 window_data->properties = mojo::MapToUnorderedMap(window->properties()); |
| 1088 window_data->visible = window->visible(); | 1095 window_data->visible = window->visible(); |
| 1096 window_data->local_surface_id = window->current_local_surface_id(); |
| 1089 return window_data; | 1097 return window_data; |
| 1090 } | 1098 } |
| 1091 | 1099 |
| 1092 void WindowTree::GetWindowTreeImpl( | 1100 void WindowTree::GetWindowTreeImpl( |
| 1093 const ServerWindow* window, | 1101 const ServerWindow* window, |
| 1094 std::vector<const ServerWindow*>* windows) const { | 1102 std::vector<const ServerWindow*>* windows) const { |
| 1095 DCHECK(window); | 1103 DCHECK(window); |
| 1096 | 1104 |
| 1097 if (!access_policy_->CanGetWindowTree(window)) | 1105 if (!access_policy_->CanGetWindowTree(window)) |
| 1098 return; | 1106 return; |
| (...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2002 DVLOG(1) << "SetExtendedHitArea supplied unknown window"; | 2010 DVLOG(1) << "SetExtendedHitArea supplied unknown window"; |
| 2003 return; | 2011 return; |
| 2004 } | 2012 } |
| 2005 if (window->id().client_id != id_) { | 2013 if (window->id().client_id != id_) { |
| 2006 DVLOG(1) << "SetExtendedHitArea supplied window that client does not own"; | 2014 DVLOG(1) << "SetExtendedHitArea supplied window that client does not own"; |
| 2007 return; | 2015 return; |
| 2008 } | 2016 } |
| 2009 window->set_extended_hit_test_region(hit_area); | 2017 window->set_extended_hit_test_region(hit_area); |
| 2010 } | 2018 } |
| 2011 | 2019 |
| 2020 void WindowTree::WmSetBoundsResponse( |
| 2021 uint32_t change_id, |
| 2022 const gfx::Rect& bounds, |
| 2023 const cc::LocalSurfaceId& local_surface_id) { |
| 2024 window_server_->WindowManagerSetBoundsResponse(change_id, bounds, |
| 2025 local_surface_id); |
| 2026 } |
| 2027 |
| 2012 void WindowTree::WmResponse(uint32_t change_id, bool response) { | 2028 void WindowTree::WmResponse(uint32_t change_id, bool response) { |
| 2013 if (window_server_->in_move_loop() && | 2029 if (window_server_->in_move_loop() && |
| 2014 window_server_->GetCurrentMoveLoopChangeId() == change_id) { | 2030 window_server_->GetCurrentMoveLoopChangeId() == change_id) { |
| 2015 ServerWindow* window = window_server_->GetCurrentMoveLoopWindow(); | 2031 ServerWindow* window = window_server_->GetCurrentMoveLoopWindow(); |
| 2016 | 2032 |
| 2017 if (window->id().client_id != id_) { | 2033 if (window->id().client_id != id_) { |
| 2018 window_server_->WindowManagerSentBogusMessage(); | 2034 window_server_->WindowManagerSentBogusMessage(); |
| 2019 window = nullptr; | 2035 window = nullptr; |
| 2020 } else { | 2036 } else { |
| 2021 WindowManagerDisplayRoot* display_root = | 2037 WindowManagerDisplayRoot* display_root = |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2219 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2235 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
| 2220 effect_bitmask, callback); | 2236 effect_bitmask, callback); |
| 2221 } | 2237 } |
| 2222 | 2238 |
| 2223 void WindowTree::PerformOnDragDropDone() { | 2239 void WindowTree::PerformOnDragDropDone() { |
| 2224 client()->OnDragDropDone(); | 2240 client()->OnDragDropDone(); |
| 2225 } | 2241 } |
| 2226 | 2242 |
| 2227 } // namespace ws | 2243 } // namespace ws |
| 2228 } // namespace ui | 2244 } // namespace ui |
| OLD | NEW |