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" |
11 #include "ui/compositor/layer.h" | 11 #include "ui/compositor/layer.h" |
12 #include "ui/compositor/scoped_layer_animation_settings.h" | 12 #include "ui/compositor/scoped_layer_animation_settings.h" |
13 #include "ui/gfx/canvas.h" | 13 #include "ui/gfx/canvas.h" |
| 14 #include "ui/gfx/geometry/insets.h" |
14 #include "ui/gfx/image/canvas_image_source.h" | 15 #include "ui/gfx/image/canvas_image_source.h" |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 // The width of the resize shadow that appears on the hovered edge of the | 19 // The width of the resize shadow that appears on the hovered edge of the |
19 // window. | 20 // window. |
20 constexpr int kVisualThickness = 8; | 21 constexpr int kVisualThickness = 8; |
21 | 22 |
22 // The corner radius of the resize shadow, which not coincidentally matches | 23 // The corner radius of the resize shadow, which not coincidentally matches |
23 // the corner radius of the actual window. | 24 // the corner radius of the actual window. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 constexpr int kShadowFadeOutDurationMs = 100; | 159 constexpr int kShadowFadeOutDurationMs = 100; |
159 settings.SetTransitionDuration( | 160 settings.SetTransitionDuration( |
160 base::TimeDelta::FromMilliseconds(kShadowFadeOutDurationMs)); | 161 base::TimeDelta::FromMilliseconds(kShadowFadeOutDurationMs)); |
161 } | 162 } |
162 constexpr float kShadowTargetOpacity = 0.5f; | 163 constexpr float kShadowTargetOpacity = 0.5f; |
163 layer_->SetOpacity(visible ? kShadowTargetOpacity : 0.f); | 164 layer_->SetOpacity(visible ? kShadowTargetOpacity : 0.f); |
164 layer_->SetVisible(visible); | 165 layer_->SetVisible(visible); |
165 } | 166 } |
166 | 167 |
167 } // namespace ash | 168 } // namespace ash |
OLD | NEW |