| 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 "services/ui/ws/focus_controller.h" | 5 #include "services/ui/ws/focus_controller.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "services/ui/public/interfaces/window_manager.mojom.h" | 8 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 9 #include "services/ui/ws/focus_controller_delegate.h" | 9 #include "services/ui/ws/focus_controller_delegate.h" |
| 10 #include "services/ui/ws/focus_controller_observer.h" | 10 #include "services/ui/ws/focus_controller_observer.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 return false; | 178 return false; |
| 179 | 179 |
| 180 if (!window->can_focus()) | 180 if (!window->can_focus()) |
| 181 return false; | 181 return false; |
| 182 | 182 |
| 183 // The window must be drawn, or if it's not drawn, it must be minimized. | 183 // The window must be drawn, or if it's not drawn, it must be minimized. |
| 184 if (!window->IsDrawn()) { | 184 if (!window->IsDrawn()) { |
| 185 bool is_minimized = false; | 185 bool is_minimized = false; |
| 186 const ServerWindow::Properties& props = window->properties(); | 186 const ServerWindow::Properties& props = window->properties(); |
| 187 if (props.count(mojom::WindowManager::kShowState_Property)) { | 187 if (props.count(mojom::WindowManager::kShowState_Property)) { |
| 188 // The type must match that of PropertyConverter::PrimitiveType. |
| 188 is_minimized = | 189 is_minimized = |
| 189 props.find(mojom::WindowManager::kShowState_Property)->second[0] == | 190 props.find(mojom::WindowManager::kShowState_Property)->second[0] == |
| 190 static_cast<int>(ui::mojom::ShowState::MINIMIZED); | 191 static_cast<int64_t>(ui::mojom::ShowState::MINIMIZED); |
| 191 } | 192 } |
| 192 if (!is_minimized) | 193 if (!is_minimized) |
| 193 return false; | 194 return false; |
| 194 } | 195 } |
| 195 | 196 |
| 196 // TODO(sad): If there's a transient modal window, then this cannot be | 197 // TODO(sad): If there's a transient modal window, then this cannot be |
| 197 // activated. | 198 // activated. |
| 198 return true; | 199 return true; |
| 199 } | 200 } |
| 200 | 201 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } | 305 } |
| 305 | 306 |
| 306 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, | 307 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, |
| 307 ServerWindow* window, | 308 ServerWindow* window, |
| 308 bool is_drawn) { | 309 bool is_drawn) { |
| 309 // DCHECK(false); TODO(sadrul): | 310 // DCHECK(false); TODO(sadrul): |
| 310 } | 311 } |
| 311 | 312 |
| 312 } // namespace ws | 313 } // namespace ws |
| 313 } // namespace ui | 314 } // namespace ui |
| OLD | NEW |