OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/wm/resize_shadow_controller.h" | 5 #include "ash/wm/resize_shadow_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/wm/resize_shadow.h" | 9 #include "ash/wm/resize_shadow.h" |
| 10 #include "base/memory/ptr_util.h" |
10 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
11 | 12 |
12 namespace ash { | 13 namespace ash { |
13 | 14 |
14 ResizeShadowController::ResizeShadowController() {} | 15 ResizeShadowController::ResizeShadowController() {} |
15 | 16 |
16 ResizeShadowController::~ResizeShadowController() { | 17 ResizeShadowController::~ResizeShadowController() { |
17 for (const auto& shadow : window_shadows_) | 18 for (const auto& shadow : window_shadows_) |
18 shadow.first->RemoveObserver(this); | 19 shadow.first->RemoveObserver(this); |
19 } | 20 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 window_shadows_.insert(std::make_pair(window, std::move(shadow))); | 63 window_shadows_.insert(std::make_pair(window, std::move(shadow))); |
63 return raw_shadow; | 64 return raw_shadow; |
64 } | 65 } |
65 | 66 |
66 ResizeShadow* ResizeShadowController::GetShadowForWindow(aura::Window* window) { | 67 ResizeShadow* ResizeShadowController::GetShadowForWindow(aura::Window* window) { |
67 auto it = window_shadows_.find(window); | 68 auto it = window_shadows_.find(window); |
68 return it != window_shadows_.end() ? it->second.get() : nullptr; | 69 return it != window_shadows_.end() ? it->second.get() : nullptr; |
69 } | 70 } |
70 | 71 |
71 } // namespace ash | 72 } // namespace ash |
OLD | NEW |