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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 DCHECK(root_); | 68 DCHECK(root_); |
69 } | 69 } |
70 | 70 |
71 FocusController::~FocusController() { | 71 FocusController::~FocusController() { |
72 } | 72 } |
73 | 73 |
74 void FocusController::SetFocusedWindow(ServerWindow* window) { | 74 void FocusController::SetFocusedWindow(ServerWindow* window) { |
75 if (GetFocusedWindow() == window) | 75 if (GetFocusedWindow() == window) |
76 return; | 76 return; |
77 | 77 |
| 78 // TODO(jamescook): Failures to set focus should be propagated back to the |
| 79 // client so it doesn't get out of sync. http://crbug.com/600869 |
78 SetFocusedWindowImpl(FocusControllerChangeSource::EXPLICIT, window); | 80 SetFocusedWindowImpl(FocusControllerChangeSource::EXPLICIT, window); |
79 } | 81 } |
80 | 82 |
81 ServerWindow* FocusController::GetFocusedWindow() { | 83 ServerWindow* FocusController::GetFocusedWindow() { |
82 return focused_window_; | 84 return focused_window_; |
83 } | 85 } |
84 | 86 |
85 void FocusController::ActivateNextWindow() { | 87 void FocusController::ActivateNextWindow() { |
86 WindowTreeIterator iter(root_); | 88 WindowTreeIterator iter(root_); |
87 ServerWindow* activate = active_window_; | 89 ServerWindow* activate = active_window_; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 } | 302 } |
301 | 303 |
302 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, | 304 void FocusController::OnDrawnStateChanged(ServerWindow* ancestor, |
303 ServerWindow* window, | 305 ServerWindow* window, |
304 bool is_drawn) { | 306 bool is_drawn) { |
305 // DCHECK(false); TODO(sadrul): | 307 // DCHECK(false); TODO(sadrul): |
306 } | 308 } |
307 | 309 |
308 } // namespace ws | 310 } // namespace ws |
309 } // namespace mus | 311 } // namespace mus |
OLD | NEW |