| 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.h" | 5 #include "ash/mus/shadow.h" |
| 6 | 6 |
| 7 #include "third_party/skia/include/core/SkBitmap.h" | 7 #include "third_party/skia/include/core/SkBitmap.h" |
| 8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/aura/window_property.h" | 9 #include "ui/base/class_property.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.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/resources/grit/ui_resources.h" | 13 #include "ui/resources/grit/ui_resources.h" |
| 14 | 14 |
| 15 DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::Shadow*); | 15 DECLARE_UI_CLASS_PROPERTY_TYPE(ash::mus::Shadow*); |
| 16 | 16 |
| 17 namespace ash { | 17 namespace ash { |
| 18 namespace mus { | 18 namespace mus { |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 DEFINE_WINDOW_PROPERTY_KEY(Shadow*, kShadowProperty, nullptr); | 21 DEFINE_UI_CLASS_PROPERTY_KEY(Shadow*, kShadowProperty, nullptr); |
| 22 | 22 |
| 23 // The opacity used for active shadow when animating between | 23 // The opacity used for active shadow when animating between |
| 24 // inactive/active shadow. | 24 // inactive/active shadow. |
| 25 const float kInactiveShadowAnimationOpacity = 0.2f; | 25 const float kInactiveShadowAnimationOpacity = 0.2f; |
| 26 | 26 |
| 27 // Shadow aperture for different styles. | 27 // Shadow aperture for different styles. |
| 28 // Note that this may be greater than interior inset to allow shadows with | 28 // Note that this may be greater than interior inset to allow shadows with |
| 29 // curved corners that extend inwards beyond a window's borders. | 29 // curved corners that extend inwards beyond a window's borders. |
| 30 const int kActiveInteriorAperture = 134; | 30 const int kActiveInteriorAperture = 134; |
| 31 const int kInactiveInteriorAperture = 134; | 31 const int kInactiveInteriorAperture = 134; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 shadow_layer_->UpdateNinePatchOcclusion(content_bounds); | 225 shadow_layer_->UpdateNinePatchOcclusion(content_bounds); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void Shadow::OnWindowDestroyed(aura::Window* window) { | 228 void Shadow::OnWindowDestroyed(aura::Window* window) { |
| 229 DCHECK_EQ(window_, window); | 229 DCHECK_EQ(window_, window); |
| 230 window_ = nullptr; | 230 window_ = nullptr; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace mus | 233 } // namespace mus |
| 234 } // namespace ash | 234 } // namespace ash |
| OLD | NEW |