| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_manager_state.h" | 5 #include "services/ui/ws/window_manager_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "services/service_manager/public/interfaces/connector.mojom.h" | 11 #include "services/service_manager/public/interfaces/connector.mojom.h" |
| 12 #include "services/ui/common/accelerator_util.h" | 12 #include "services/ui/common/accelerator_util.h" |
| 13 #include "services/ui/ws/accelerator.h" | 13 #include "services/ui/ws/accelerator.h" |
| 14 #include "services/ui/ws/cursor_location_manager.h" | 14 #include "services/ui/ws/cursor_location_manager.h" |
| 15 #include "services/ui/ws/display.h" | 15 #include "services/ui/ws/display.h" |
| 16 #include "services/ui/ws/display_creation_config.h" |
| 16 #include "services/ui/ws/display_manager.h" | 17 #include "services/ui/ws/display_manager.h" |
| 17 #include "services/ui/ws/platform_display.h" | 18 #include "services/ui/ws/platform_display.h" |
| 18 #include "services/ui/ws/server_window.h" | 19 #include "services/ui/ws/server_window.h" |
| 19 #include "services/ui/ws/user_display_manager.h" | 20 #include "services/ui/ws/user_display_manager.h" |
| 20 #include "services/ui/ws/user_id_tracker.h" | 21 #include "services/ui/ws/user_id_tracker.h" |
| 21 #include "services/ui/ws/window_manager_display_root.h" | 22 #include "services/ui/ws/window_manager_display_root.h" |
| 22 #include "services/ui/ws/window_server.h" | 23 #include "services/ui/ws/window_server.h" |
| 23 #include "services/ui/ws/window_tree.h" | 24 #include "services/ui/ws/window_tree.h" |
| 24 #include "ui/events/event.h" | 25 #include "ui/events/event.h" |
| 25 | 26 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 if (window_tree_->automatically_create_display_roots()) { | 148 if (window_tree_->automatically_create_display_roots()) { |
| 148 for (auto& display_root : orphaned_window_manager_display_roots_) | 149 for (auto& display_root : orphaned_window_manager_display_roots_) |
| 149 display_root->root()->RemoveObserver(this); | 150 display_root->root()->RemoveObserver(this); |
| 150 } | 151 } |
| 151 } | 152 } |
| 152 | 153 |
| 153 void WindowManagerState::SetFrameDecorationValues( | 154 void WindowManagerState::SetFrameDecorationValues( |
| 154 mojom::FrameDecorationValuesPtr values) { | 155 mojom::FrameDecorationValuesPtr values) { |
| 155 got_frame_decoration_values_ = true; | 156 got_frame_decoration_values_ = true; |
| 156 frame_decoration_values_ = values.Clone(); | 157 frame_decoration_values_ = values.Clone(); |
| 157 display_manager() | 158 UserDisplayManager* user_display_manager = |
| 158 ->GetUserDisplayManager(user_id()) | 159 display_manager()->GetUserDisplayManager(user_id()); |
| 159 ->OnFrameDecorationValuesChanged(); | 160 user_display_manager->OnFrameDecorationValuesChanged(); |
| 161 if (window_server()->display_creation_config() == |
| 162 DisplayCreationConfig::MANUAL && |
| 163 display_manager()->got_initial_config_from_window_manager()) { |
| 164 user_display_manager->CallOnDisplaysChanged(); |
| 165 } |
| 160 } | 166 } |
| 161 | 167 |
| 162 bool WindowManagerState::SetCapture(ServerWindow* window, | 168 bool WindowManagerState::SetCapture(ServerWindow* window, |
| 163 ClientSpecificId client_id) { | 169 ClientSpecificId client_id) { |
| 164 DCHECK(IsActive()); | 170 DCHECK(IsActive()); |
| 165 if (capture_window() == window && | 171 if (capture_window() == window && |
| 166 client_id == event_dispatcher_.capture_window_client_id()) { | 172 client_id == event_dispatcher_.capture_window_client_id()) { |
| 167 return true; | 173 return true; |
| 168 } | 174 } |
| 169 #if DCHECK_IS_ON() | 175 #if DCHECK_IS_ON() |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 window->RemoveObserver(this); | 719 window->RemoveObserver(this); |
| 714 orphaned_window_manager_display_roots_.erase(iter); | 720 orphaned_window_manager_display_roots_.erase(iter); |
| 715 return; | 721 return; |
| 716 } | 722 } |
| 717 } | 723 } |
| 718 NOTREACHED(); | 724 NOTREACHED(); |
| 719 } | 725 } |
| 720 | 726 |
| 721 } // namespace ws | 727 } // namespace ws |
| 722 } // namespace ui | 728 } // namespace ui |
| OLD | NEW |