| 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/shadow_controller.h" | 5 #include "ash/mus/shadow_controller.h" |
| 6 | 6 |
| 7 #include "ash/mus/property_util.h" | 7 #include "ash/mus/property_util.h" |
| 8 #include "ash/mus/shadow.h" | 8 #include "ash/mus/shadow.h" |
| 9 #include "components/mus/public/cpp/window.h" | 9 #include "services/ui/public/cpp/window.h" |
| 10 #include "components/mus/public/cpp/window_tree_client.h" | 10 #include "services/ui/public/cpp/window_tree_client.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 namespace mus { | 13 namespace mus { |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // Returns the first ancestor of |from| (including |from|) that has a shadow. | 16 // Returns the first ancestor of |from| (including |from|) that has a shadow. |
| 17 ::mus::Window* FindAncestorWithShadow(::mus::Window* from) { | 17 ::mus::Window* FindAncestorWithShadow(::mus::Window* from) { |
| 18 ::mus::Window* result = from; | 18 ::mus::Window* result = from; |
| 19 while (result && !GetShadow(result)) | 19 while (result && !GetShadow(result)) |
| 20 result = result->parent(); | 20 result = result->parent(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 SetActiveWindow(FindAncestorWithShadow(gained_focus)); | 58 SetActiveWindow(FindAncestorWithShadow(gained_focus)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void ShadowController::OnWindowDestroying(::mus::Window* window) { | 61 void ShadowController::OnWindowDestroying(::mus::Window* window) { |
| 62 DCHECK_EQ(window, active_window_); | 62 DCHECK_EQ(window, active_window_); |
| 63 SetActiveWindow(nullptr); | 63 SetActiveWindow(nullptr); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace mus | 66 } // namespace mus |
| 67 } // namespace ash | 67 } // namespace ash |
| OLD | NEW |