| 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_server.h" | 5 #include "services/ui/ws/window_server.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 display_manager_->DestroyAllDisplays(); | 76 display_manager_->DestroyAllDisplays(); |
| 77 | 77 |
| 78 while (!tree_map_.empty()) | 78 while (!tree_map_.empty()) |
| 79 DestroyTree(tree_map_.begin()->second.get()); | 79 DestroyTree(tree_map_.begin()->second.get()); |
| 80 | 80 |
| 81 display_manager_.reset(); | 81 display_manager_.reset(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 ServerWindow* WindowServer::CreateServerWindow( | 84 ServerWindow* WindowServer::CreateServerWindow( |
| 85 const WindowId& id, | 85 const WindowId& id, |
| 86 const std::map<std::string, std::vector<uint8_t>>& properties) { | 86 const std::map<std::string, std::vector<uint8_t>>& properties, |
| 87 ServerWindow* window = new ServerWindow(this, id, properties); | 87 const cc::LocalFrameId& local_frame_id) { |
| 88 ServerWindow* window = new ServerWindow(this, id, properties, local_frame_id); |
| 88 window->AddObserver(this); | 89 window->AddObserver(this); |
| 89 return window; | 90 return window; |
| 90 } | 91 } |
| 91 | 92 |
| 92 ClientSpecificId WindowServer::GetAndAdvanceNextClientId() { | 93 ClientSpecificId WindowServer::GetAndAdvanceNextClientId() { |
| 93 const ClientSpecificId id = next_client_id_++; | 94 const ClientSpecificId id = next_client_id_++; |
| 94 DCHECK_LT(id, next_client_id_); | 95 DCHECK_LT(id, next_client_id_); |
| 95 return id; | 96 return id; |
| 96 } | 97 } |
| 97 | 98 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 << "created by the WindowManager, window_manager_change_id=" | 340 << "created by the WindowManager, window_manager_change_id=" |
| 340 << window_manager_change_id; | 341 << window_manager_change_id; |
| 341 WindowManagerSentBogusMessage(); | 342 WindowManagerSentBogusMessage(); |
| 342 return; | 343 return; |
| 343 } | 344 } |
| 344 | 345 |
| 345 tree->OnWindowManagerCreatedTopLevelWindow(window_manager_change_id, | 346 tree->OnWindowManagerCreatedTopLevelWindow(window_manager_change_id, |
| 346 change.client_change_id, window); | 347 change.client_change_id, window); |
| 347 } | 348 } |
| 348 | 349 |
| 349 void WindowServer::ProcessWindowBoundsChanged(const ServerWindow* window, | 350 void WindowServer::ProcessWindowBoundsChanged( |
| 350 const gfx::Rect& old_bounds, | 351 const ServerWindow* window, |
| 351 const gfx::Rect& new_bounds) { | 352 const gfx::Rect& old_bounds, |
| 353 const gfx::Rect& new_bounds, |
| 354 const cc::LocalFrameId& local_frame_id) { |
| 352 for (auto& pair : tree_map_) { | 355 for (auto& pair : tree_map_) { |
| 353 pair.second->ProcessWindowBoundsChanged(window, old_bounds, new_bounds, | 356 pair.second->ProcessWindowBoundsChanged(window, old_bounds, new_bounds, |
| 354 IsOperationSource(pair.first)); | 357 IsOperationSource(pair.first), |
| 358 local_frame_id); |
| 355 } | 359 } |
| 356 } | 360 } |
| 357 | 361 |
| 358 void WindowServer::ProcessClientAreaChanged( | 362 void WindowServer::ProcessClientAreaChanged( |
| 359 const ServerWindow* window, | 363 const ServerWindow* window, |
| 360 const gfx::Insets& new_client_area, | 364 const gfx::Insets& new_client_area, |
| 361 const std::vector<gfx::Rect>& new_additional_client_areas) { | 365 const std::vector<gfx::Rect>& new_additional_client_areas) { |
| 362 for (auto& pair : tree_map_) { | 366 for (auto& pair : tree_map_) { |
| 363 pair.second->ProcessClientAreaChanged(window, new_client_area, | 367 pair.second->ProcessClientAreaChanged(window, new_client_area, |
| 364 new_additional_client_areas, | 368 new_additional_client_areas, |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 display_manager_->GetWindowManagerDisplayRoot(window); | 643 display_manager_->GetWindowManagerDisplayRoot(window); |
| 640 if (display_root) | 644 if (display_root) |
| 641 display_root->window_manager_state() | 645 display_root->window_manager_state() |
| 642 ->ReleaseCaptureBlockedByAnyModalWindow(); | 646 ->ReleaseCaptureBlockedByAnyModalWindow(); |
| 643 | 647 |
| 644 ProcessWindowHierarchyChanged(window, new_parent, old_parent); | 648 ProcessWindowHierarchyChanged(window, new_parent, old_parent); |
| 645 | 649 |
| 646 UpdateNativeCursorFromMouseLocation(window); | 650 UpdateNativeCursorFromMouseLocation(window); |
| 647 } | 651 } |
| 648 | 652 |
| 649 void WindowServer::OnWindowBoundsChanged(ServerWindow* window, | 653 void WindowServer::OnWindowBoundsChanged( |
| 650 const gfx::Rect& old_bounds, | 654 ServerWindow* window, |
| 651 const gfx::Rect& new_bounds) { | 655 const gfx::Rect& old_bounds, |
| 656 const gfx::Rect& new_bounds, |
| 657 const cc::LocalFrameId& local_frame_id) { |
| 652 if (in_destructor_) | 658 if (in_destructor_) |
| 653 return; | 659 return; |
| 654 | 660 |
| 655 ProcessWindowBoundsChanged(window, old_bounds, new_bounds); | 661 ProcessWindowBoundsChanged(window, old_bounds, new_bounds, local_frame_id); |
| 656 if (!window->parent()) | 662 if (!window->parent()) |
| 657 return; | 663 return; |
| 658 | 664 |
| 659 UpdateNativeCursorFromMouseLocation(window); | 665 UpdateNativeCursorFromMouseLocation(window); |
| 660 } | 666 } |
| 661 | 667 |
| 662 void WindowServer::OnWindowClientAreaChanged( | 668 void WindowServer::OnWindowClientAreaChanged( |
| 663 ServerWindow* window, | 669 ServerWindow* window, |
| 664 const gfx::Insets& new_client_area, | 670 const gfx::Insets& new_client_area, |
| 665 const std::vector<gfx::Rect>& new_additional_client_areas) { | 671 const std::vector<gfx::Rect>& new_additional_client_areas) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 void WindowServer::OnUserIdAdded(const UserId& id) { | 819 void WindowServer::OnUserIdAdded(const UserId& id) { |
| 814 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); | 820 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); |
| 815 } | 821 } |
| 816 | 822 |
| 817 void WindowServer::OnUserIdRemoved(const UserId& id) { | 823 void WindowServer::OnUserIdRemoved(const UserId& id) { |
| 818 activity_monitor_map_.erase(id); | 824 activity_monitor_map_.erase(id); |
| 819 } | 825 } |
| 820 | 826 |
| 821 } // namespace ws | 827 } // namespace ws |
| 822 } // namespace ui | 828 } // namespace ui |
| OLD | NEW |