| 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 "components/mus/ws/window_manager_factory_registry.h" | 5 #include "components/mus/ws/window_manager_factory_registry.h" |
| 6 | 6 |
| 7 #include "components/mus/ws/connection_manager.h" | 7 #include "components/mus/ws/connection_manager.h" |
| 8 #include "components/mus/ws/user_id_tracker_observer.h" | 8 #include "components/mus/ws/user_id_tracker_observer.h" |
| 9 #include "components/mus/ws/window_manager_factory_registry_observer.h" | 9 #include "components/mus/ws/window_manager_factory_registry_observer.h" |
| 10 #include "components/mus/ws/window_manager_factory_service.h" | 10 #include "components/mus/ws/window_manager_factory_service.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 got_valid_factory_ = true; | 86 got_valid_factory_ = true; |
| 87 FOR_EACH_OBSERVER(WindowManagerFactoryRegistryObserver, observers_, | 87 FOR_EACH_OBSERVER(WindowManagerFactoryRegistryObserver, observers_, |
| 88 OnWindowManagerFactorySet(service)); | 88 OnWindowManagerFactorySet(service)); |
| 89 | 89 |
| 90 // Notify after other observers as ConnectionManager triggers other | 90 // Notify after other observers as ConnectionManager triggers other |
| 91 // observers being added, which will have already processed the add. | 91 // observers being added, which will have already processed the add. |
| 92 if (is_first_valid_factory) | 92 if (is_first_valid_factory) |
| 93 connection_manager_->OnFirstWindowManagerFactorySet(); | 93 connection_manager_->OnFirstWindowManagerFactorySet(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void WindowManagerFactoryRegistry::OnActiveUserIdChanged(const UserId& id) {} | 96 void WindowManagerFactoryRegistry::OnActiveUserIdChanged( |
| 97 const UserId& previously_active_id, |
| 98 const UserId& active_id) {} |
| 97 | 99 |
| 98 void WindowManagerFactoryRegistry::OnUserIdAdded(const UserId& id) {} | 100 void WindowManagerFactoryRegistry::OnUserIdAdded(const UserId& id) {} |
| 99 | 101 |
| 100 void WindowManagerFactoryRegistry::OnUserIdRemoved(const UserId& id) { | 102 void WindowManagerFactoryRegistry::OnUserIdRemoved(const UserId& id) { |
| 101 for (auto iter = services_.begin(); iter != services_.end(); ++iter) { | 103 for (auto iter = services_.begin(); iter != services_.end(); ++iter) { |
| 102 if ((*iter)->user_id() == id) { | 104 if ((*iter)->user_id() == id) { |
| 103 services_.erase(iter); | 105 services_.erase(iter); |
| 104 return; | 106 return; |
| 105 } | 107 } |
| 106 } | 108 } |
| 107 } | 109 } |
| 108 | 110 |
| 109 } // namespace ws | 111 } // namespace ws |
| 110 } // namespace mus | 112 } // namespace mus |
| OLD | NEW |