| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/ws/display.h" | 5 #include "components/mus/ws/display.h" |
| 6 | 6 |
| 7 #include "base/debug/debugger.h" | 7 #include "base/debug/debugger.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/mus/common/types.h" | 9 #include "components/mus/common/types.h" |
| 10 #include "components/mus/ws/display_binding.h" | 10 #include "components/mus/ws/display_binding.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 if (!init_called_ || !root_) | 248 if (!init_called_ || !root_) |
| 249 return; | 249 return; |
| 250 | 250 |
| 251 display_manager()->OnDisplayAcceleratedWidgetAvailable(this); | 251 display_manager()->OnDisplayAcceleratedWidgetAvailable(this); |
| 252 if (binding_) { | 252 if (binding_) { |
| 253 scoped_ptr<WindowManagerState> wms_ptr(new WindowManagerState( | 253 scoped_ptr<WindowManagerState> wms_ptr(new WindowManagerState( |
| 254 this, platform_display_.get(), top_level_surface_id_)); | 254 this, platform_display_.get(), top_level_surface_id_)); |
| 255 WindowManagerState* wms = wms_ptr.get(); | 255 WindowManagerState* wms = wms_ptr.get(); |
| 256 // For this case we never create additional WindowManagerStates, so any | 256 // For this case we never create additional WindowManagerStates, so any |
| 257 // id works. | 257 // id works. |
| 258 window_manager_state_map_[mojo::shell::mojom::kRootUserID] = | 258 window_manager_state_map_[shell::mojom::kRootUserID] = std::move(wms_ptr); |
| 259 std::move(wms_ptr); | |
| 260 wms->tree_ = binding_->CreateWindowTree(wms->root()); | 259 wms->tree_ = binding_->CreateWindowTree(wms->root()); |
| 261 } else { | 260 } else { |
| 262 CreateWindowManagerStatesFromRegistry(); | 261 CreateWindowManagerStatesFromRegistry(); |
| 263 } | 262 } |
| 264 } | 263 } |
| 265 | 264 |
| 266 void Display::CreateWindowManagerStatesFromRegistry() { | 265 void Display::CreateWindowManagerStatesFromRegistry() { |
| 267 std::vector<WindowManagerFactoryService*> services = | 266 std::vector<WindowManagerFactoryService*> services = |
| 268 window_server_->window_manager_factory_registry()->GetServices(); | 267 window_server_->window_manager_factory_registry()->GetServices(); |
| 269 for (WindowManagerFactoryService* service : services) { | 268 for (WindowManagerFactoryService* service : services) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 DCHECK_EQ(0u, window_manager_state_map_.count(id)); | 481 DCHECK_EQ(0u, window_manager_state_map_.count(id)); |
| 483 } | 482 } |
| 484 | 483 |
| 485 void Display::OnWindowManagerFactorySet(WindowManagerFactoryService* service) { | 484 void Display::OnWindowManagerFactorySet(WindowManagerFactoryService* service) { |
| 486 if (!binding_) | 485 if (!binding_) |
| 487 CreateWindowManagerStateFromService(service); | 486 CreateWindowManagerStateFromService(service); |
| 488 } | 487 } |
| 489 | 488 |
| 490 } // namespace ws | 489 } // namespace ws |
| 491 } // namespace mus | 490 } // namespace mus |
| OLD | NEW |