| 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 "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 ResizeShadowController::ResizeShadowController() { | 14 ResizeShadowController::ResizeShadowController() {} |
| 15 } | |
| 16 | 15 |
| 17 ResizeShadowController::~ResizeShadowController() { | 16 ResizeShadowController::~ResizeShadowController() { |
| 18 for (WindowShadowMap::const_iterator it = window_shadows_.begin(); | 17 for (WindowShadowMap::const_iterator it = window_shadows_.begin(); |
| 19 it != window_shadows_.end(); ++it) { | 18 it != window_shadows_.end(); ++it) { |
| 20 it->first->RemoveObserver(this); | 19 it->first->RemoveObserver(this); |
| 21 } | 20 } |
| 22 } | 21 } |
| 23 | 22 |
| 24 void ResizeShadowController::ShowShadow(aura::Window* window, int hit_test) { | 23 void ResizeShadowController::ShowShadow(aura::Window* window, int hit_test) { |
| 25 ResizeShadow* shadow = GetShadowForWindow(window); | 24 ResizeShadow* shadow = GetShadowForWindow(window); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 window->AddObserver(this); | 62 window->AddObserver(this); |
| 64 return shadow.get(); | 63 return shadow.get(); |
| 65 } | 64 } |
| 66 | 65 |
| 67 ResizeShadow* ResizeShadowController::GetShadowForWindow(aura::Window* window) { | 66 ResizeShadow* ResizeShadowController::GetShadowForWindow(aura::Window* window) { |
| 68 WindowShadowMap::const_iterator it = window_shadows_.find(window); | 67 WindowShadowMap::const_iterator it = window_shadows_.find(window); |
| 69 return it != window_shadows_.end() ? it->second.get() : NULL; | 68 return it != window_shadows_.end() ? it->second.get() : NULL; |
| 70 } | 69 } |
| 71 | 70 |
| 72 } // namespace ash | 71 } // namespace ash |
| OLD | NEW |