Chromium Code Reviews| 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_SHADOW_H_ | |
| 6 #define UI_AURA_SHADOW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "ui/gfx/rect.h" | |
| 12 | |
| 13 namespace ui { | |
| 14 class Layer; | |
|
sky
2011/11/15 04:49:13
nit: don't indent this sort of thing.
Daniel Erat
2011/11/15 17:52:58
Done.
| |
| 15 } // namespace ui | |
| 16 | |
| 17 namespace aura { | |
| 18 namespace internal { | |
| 19 | |
| 20 class ImageGrid; | |
| 21 | |
| 22 // Simple class that draws a drop shadow around content at given bounds. | |
| 23 class Shadow { | |
| 24 public: | |
| 25 Shadow(); | |
| 26 ~Shadow(); | |
| 27 | |
| 28 // Returns |image_grid_|'s ui::Layer. This is exposed so it can be added to | |
| 29 // the same layer as the content and stacked below it. SetContentBounds() | |
| 30 // should be used to adjust the shadow's size and position (rather than | |
| 31 // applying transformations to this layer). | |
| 32 ui::Layer* layer() const; | |
| 33 | |
| 34 const gfx::Rect& content_bounds() const { return content_bounds_; } | |
| 35 | |
| 36 void Init(); | |
| 37 | |
| 38 // Moves and resizes |image_grid_| to frame |content_bounds|. | |
| 39 void SetContentBounds(const gfx::Rect& content_bounds); | |
| 40 | |
| 41 private: | |
| 42 scoped_ptr<ImageGrid> image_grid_; | |
| 43 | |
| 44 // Bounds of the content that the shadow encloses. | |
| 45 gfx::Rect content_bounds_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(Shadow); | |
| 48 }; | |
| 49 | |
| 50 } // namespace internal | |
| 51 } // namespace aura | |
| 52 | |
| 53 #endif // UI_AURA_SHADOW_H_ | |
| OLD | NEW |