| 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 #ifndef UI_WM_CORE_SHADOW_H_ | 5 #ifndef UI_WM_CORE_SHADOW_H_ |
| 6 #define UI_WM_CORE_SHADOW_H_ | 6 #define UI_WM_CORE_SHADOW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void OnImplicitAnimationsCompleted() override; | 62 void OnImplicitAnimationsCompleted() override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // Updates the shadow images to the current |style_|. | 65 // Updates the shadow images to the current |style_|. |
| 66 void UpdateImagesForStyle(); | 66 void UpdateImagesForStyle(); |
| 67 | 67 |
| 68 // Updates the shadow layer bounds based on the inteior inset and the current | 68 // Updates the shadow layer bounds based on the inteior inset and the current |
| 69 // |content_bounds_|. | 69 // |content_bounds_|. |
| 70 void UpdateLayerBounds(); | 70 void UpdateLayerBounds(); |
| 71 | 71 |
| 72 // Returns the "elevation" for |style_|, which dictates the shadow's display |
| 73 // characteristics. The elevation is proportional to the size of the blur and |
| 74 // its offset. |
| 75 int ElevationForStyle(); |
| 76 |
| 72 // The current style, set when the transition animation starts. | 77 // The current style, set when the transition animation starts. |
| 73 Style style_; | 78 Style style_ = STYLE_ACTIVE; |
| 74 | 79 |
| 75 // The parent layer of the shadow layer. It serves as a container accessible | 80 // The parent layer of the shadow layer. It serves as a container accessible |
| 76 // from the outside to control the visibility of the shadow. | 81 // from the outside to control the visibility of the shadow. |
| 77 std::unique_ptr<ui::Layer> layer_; | 82 std::unique_ptr<ui::Layer> layer_; |
| 78 | 83 |
| 79 // The actual shadow layer corresponding to a cc::NinePatchLayer. | 84 // The actual shadow layer corresponding to a cc::NinePatchLayer. |
| 80 std::unique_ptr<ui::Layer> shadow_layer_; | 85 std::unique_ptr<ui::Layer> shadow_layer_; |
| 81 | 86 |
| 82 // Size of the current shadow image. | |
| 83 gfx::Size image_size_; | |
| 84 | |
| 85 // Bounds of the content that the shadow encloses. | 87 // Bounds of the content that the shadow encloses. |
| 86 gfx::Rect content_bounds_; | 88 gfx::Rect content_bounds_; |
| 87 | 89 |
| 88 // The interior inset of the shadow images. The content bounds of the image | |
| 89 // grid should be set to |content_bounds_| inset by this amount. | |
| 90 int interior_inset_; | |
| 91 | |
| 92 DISALLOW_COPY_AND_ASSIGN(Shadow); | 90 DISALLOW_COPY_AND_ASSIGN(Shadow); |
| 93 }; | 91 }; |
| 94 | 92 |
| 95 } // namespace wm | 93 } // namespace wm |
| 96 | 94 |
| 97 #endif // UI_WM_CORE_SHADOW_H_ | 95 #endif // UI_WM_CORE_SHADOW_H_ |
| OLD | NEW |