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/focus_controller.h" | 5 #include "components/mus/ws/focus_controller.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "components/mus/public/interfaces/window_manager.mojom.h" | 8 #include "components/mus/public/interfaces/window_manager.mojom.h" |
9 #include "components/mus/ws/focus_controller_delegate.h" | 9 #include "components/mus/ws/focus_controller_delegate.h" |
10 #include "components/mus/ws/focus_controller_observer.h" | 10 #include "components/mus/ws/focus_controller_observer.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 if (!delegate_->CanHaveActiveChildren(window->parent())) | 177 if (!delegate_->CanHaveActiveChildren(window->parent())) |
178 return false; | 178 return false; |
179 | 179 |
180 // The window must be drawn, or if it's not drawn, it must be minimized. | 180 // The window must be drawn, or if it's not drawn, it must be minimized. |
181 if (!window->IsDrawn()) { | 181 if (!window->IsDrawn()) { |
182 bool is_minimized = false; | 182 bool is_minimized = false; |
183 const ServerWindow::Properties& props = window->properties(); | 183 const ServerWindow::Properties& props = window->properties(); |
184 if (props.count(mojom::WindowManager::kShowState_Property)) { | 184 if (props.count(mojom::WindowManager::kShowState_Property)) { |
185 is_minimized = | 185 is_minimized = |
186 props.find(mojom::WindowManager::kShowState_Property)->second[0] == | 186 props.find(mojom::WindowManager::kShowState_Property)->second[0] == |
187 mus::mojom::SHOW_STATE_MINIMIZED; | 187 static_cast<int>(mus::mojom::ShowState::MINIMIZED); |
188 } | 188 } |
189 if (!is_minimized) | 189 if (!is_minimized) |
190 return false; | 190 return false; |
191 } | 191 } |
192 | 192 |
193 // TODO(sad): If there's a transient modal window, then this cannot be | 193 // TODO(sad): If there's a transient modal window, then this cannot be |
194 // activated. | 194 // activated. |
195 return true; | 195 return true; |
196 } | 196 } |
197 | 197 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 291 } |
292 | 292 |
293 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, | 293 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, |
294 ServerWindow* window, | 294 ServerWindow* window, |
295 bool is_drawn) { | 295 bool is_drawn) { |
296 DCHECK(false); | 296 DCHECK(false); |
297 } | 297 } |
298 | 298 |
299 } // namespace ws | 299 } // namespace ws |
300 } // namespace mus | 300 } // namespace mus |
OLD | NEW |