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 "ash/mus/user_window_controller_impl.h" | 5 #include "ash/mus/user_window_controller_impl.h" |
6 | 6 |
7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
8 #include "ash/mus/bridge/wm_window_mus.h" | 8 #include "ash/mus/bridge/wm_window_mus.h" |
9 #include "ash/mus/property_util.h" | 9 #include "ash/mus/property_util.h" |
10 #include "ash/mus/root_window_controller.h" | 10 #include "ash/mus/root_window_controller.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 | 119 |
120 void UserWindowControllerImpl::AssignIdIfNecessary(::mus::Window* window) { | 120 void UserWindowControllerImpl::AssignIdIfNecessary(::mus::Window* window) { |
121 if (window->GetLocalProperty(kUserWindowIdKey) == 0u) | 121 if (window->GetLocalProperty(kUserWindowIdKey) == 0u) |
122 window->SetLocalProperty(kUserWindowIdKey, next_id_++); | 122 window->SetLocalProperty(kUserWindowIdKey, next_id_++); |
123 } | 123 } |
124 | 124 |
125 void UserWindowControllerImpl::RemoveObservers(::mus::Window* user_container) { | 125 void UserWindowControllerImpl::RemoveObservers(::mus::Window* user_container) { |
126 user_container->RemoveObserver(this); | 126 user_container->RemoveObserver(this); |
127 user_container->window_tree()->RemoveObserver(this); | 127 user_container->window_tree()->RemoveObserver(this); |
128 for (auto iter : user_container->children()) | 128 for (auto* iter : user_container->children()) |
129 iter->RemoveObserver(window_property_observer_.get()); | 129 iter->RemoveObserver(window_property_observer_.get()); |
130 } | 130 } |
131 | 131 |
132 ::mus::Window* UserWindowControllerImpl::GetUserWindowById(uint32_t id) { | 132 ::mus::Window* UserWindowControllerImpl::GetUserWindowById(uint32_t id) { |
133 for (::mus::Window* window : GetUserWindowContainer()->children()) { | 133 for (::mus::Window* window : GetUserWindowContainer()->children()) { |
134 if (window->GetLocalProperty(kUserWindowIdKey) == id) | 134 if (window->GetLocalProperty(kUserWindowIdKey) == id) |
135 return window; | 135 return window; |
136 } | 136 } |
137 return nullptr; | 137 return nullptr; |
138 } | 138 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 void UserWindowControllerImpl::FocusUserWindow(uint32_t window_id) { | 201 void UserWindowControllerImpl::FocusUserWindow(uint32_t window_id) { |
202 ::mus::Window* window = GetUserWindowById(window_id); | 202 ::mus::Window* window = GetUserWindowById(window_id); |
203 if (window) | 203 if (window) |
204 window->SetFocus(); | 204 window->SetFocus(); |
205 } | 205 } |
206 | 206 |
207 } // namespace mus | 207 } // namespace mus |
208 } // namespace ash | 208 } // namespace ash |
OLD | NEW |