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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (!delegate_->CanHaveActiveChildren(window->parent())) | 148 if (!delegate_->CanHaveActiveChildren(window->parent())) |
149 return false; | 149 return false; |
150 | 150 |
151 // The window must be drawn, or if it's not drawn, it must be minimized. | 151 // The window must be drawn, or if it's not drawn, it must be minimized. |
152 if (!window->IsDrawn()) { | 152 if (!window->IsDrawn()) { |
153 bool is_minimized = false; | 153 bool is_minimized = false; |
154 const ServerWindow::Properties& props = window->properties(); | 154 const ServerWindow::Properties& props = window->properties(); |
155 if (props.count(mojom::WindowManager::kShowState_Property)) { | 155 if (props.count(mojom::WindowManager::kShowState_Property)) { |
156 is_minimized = | 156 is_minimized = |
157 props.find(mojom::WindowManager::kShowState_Property)->second[0] == | 157 props.find(mojom::WindowManager::kShowState_Property)->second[0] == |
158 mus::mojom::SHOW_STATE_MINIMIZED; | 158 static_cast<int>(mus::mojom::ShowState::MINIMIZED); |
159 } | 159 } |
160 if (!is_minimized) | 160 if (!is_minimized) |
161 return false; | 161 return false; |
162 } | 162 } |
163 | 163 |
164 // TODO(sad): If there's a transient modal window, then this cannot be | 164 // TODO(sad): If there's a transient modal window, then this cannot be |
165 // activated. | 165 // activated. |
166 return true; | 166 return true; |
167 } | 167 } |
168 | 168 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 } | 261 } |
262 | 262 |
263 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, | 263 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, |
264 ServerWindow* window, | 264 ServerWindow* window, |
265 bool is_drawn) { | 265 bool is_drawn) { |
266 DCHECK(false); | 266 DCHECK(false); |
267 } | 267 } |
268 | 268 |
269 } // namespace ws | 269 } // namespace ws |
270 } // namespace mus | 270 } // namespace mus |
OLD | NEW |