| 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.h" | 5 #include "ash/wm/resize_shadow.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 const gfx::Rect& old_bounds, | 87 const gfx::Rect& old_bounds, |
| 88 const gfx::Rect& new_bounds) { | 88 const gfx::Rect& new_bounds) { |
| 89 UpdateBoundsAndVisibility(); | 89 UpdateBoundsAndVisibility(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void ResizeShadow::OnWindowHierarchyChanged( | 92 void ResizeShadow::OnWindowHierarchyChanged( |
| 93 const aura::WindowObserver::HierarchyChangeParams& params) { | 93 const aura::WindowObserver::HierarchyChangeParams& params) { |
| 94 ReparentLayer(); | 94 ReparentLayer(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void ResizeShadow::OnWindowStackingChanged(aura::Window* window) { |
| 98 ReparentLayer(); |
| 99 } |
| 100 |
| 97 void ResizeShadow::ShowForHitTest(int hit) { | 101 void ResizeShadow::ShowForHitTest(int hit) { |
| 98 // Don't start animations unless something changed. | 102 // Don't start animations unless something changed. |
| 99 if (hit == last_hit_test_) | 103 if (hit == last_hit_test_) |
| 100 return; | 104 return; |
| 101 last_hit_test_ = hit; | 105 last_hit_test_ = hit; |
| 102 | 106 |
| 103 UpdateBoundsAndVisibility(); | 107 UpdateBoundsAndVisibility(); |
| 104 } | 108 } |
| 105 | 109 |
| 106 void ResizeShadow::Hide() { | 110 void ResizeShadow::Hide() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 constexpr int kShadowFadeOutDurationMs = 100; | 148 constexpr int kShadowFadeOutDurationMs = 100; |
| 145 settings.SetTransitionDuration( | 149 settings.SetTransitionDuration( |
| 146 base::TimeDelta::FromMilliseconds(kShadowFadeOutDurationMs)); | 150 base::TimeDelta::FromMilliseconds(kShadowFadeOutDurationMs)); |
| 147 } | 151 } |
| 148 constexpr float kShadowTargetOpacity = 0.5f; | 152 constexpr float kShadowTargetOpacity = 0.5f; |
| 149 layer_->SetOpacity(visible ? kShadowTargetOpacity : 0.f); | 153 layer_->SetOpacity(visible ? kShadowTargetOpacity : 0.f); |
| 150 layer_->SetVisible(visible); | 154 layer_->SetVisible(visible); |
| 151 } | 155 } |
| 152 | 156 |
| 153 } // namespace ash | 157 } // namespace ash |
| OLD | NEW |