| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_AURA_SHELL_SHADOW_H_ | |
| 6 #define UI_AURA_SHELL_SHADOW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "ui/aura_shell/aura_shell_export.h" | |
| 12 #include "ui/gfx/rect.h" | |
| 13 | |
| 14 namespace ui { | |
| 15 class Layer; | |
| 16 } // namespace ui | |
| 17 | |
| 18 namespace aura_shell { | |
| 19 namespace internal { | |
| 20 | |
| 21 class ImageGrid; | |
| 22 | |
| 23 // Simple class that draws a drop shadow around content at given bounds. | |
| 24 class AURA_SHELL_EXPORT Shadow { | |
| 25 public: | |
| 26 Shadow(); | |
| 27 ~Shadow(); | |
| 28 | |
| 29 // Returns |image_grid_|'s ui::Layer. This is exposed so it can be added to | |
| 30 // the same layer as the content and stacked below it. SetContentBounds() | |
| 31 // should be used to adjust the shadow's size and position (rather than | |
| 32 // applying transformations to this layer). | |
| 33 ui::Layer* layer() const; | |
| 34 | |
| 35 const gfx::Rect& content_bounds() const { return content_bounds_; } | |
| 36 | |
| 37 void Init(); | |
| 38 | |
| 39 // Moves and resizes |image_grid_| to frame |content_bounds|. | |
| 40 void SetContentBounds(const gfx::Rect& content_bounds); | |
| 41 | |
| 42 private: | |
| 43 scoped_ptr<ImageGrid> image_grid_; | |
| 44 | |
| 45 // Bounds of the content that the shadow encloses. | |
| 46 gfx::Rect content_bounds_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(Shadow); | |
| 49 }; | |
| 50 | |
| 51 } // namespace internal | |
| 52 } // namespace aura_shell | |
| 53 | |
| 54 #endif // UI_AURA_SHELL_SHADOW_H_ | |
| OLD | NEW |