summaryrefslogtreecommitdiffstats
path: root/ash/wm/resize_shadow.h
diff options
context:
space:
mode:
Diffstat (limited to 'ash/wm/resize_shadow.h')
-rw-r--r--ash/wm/resize_shadow.h38
1 files changed, 10 insertions, 28 deletions
diff --git a/ash/wm/resize_shadow.h b/ash/wm/resize_shadow.h
index b0307fa..0961607 100644
--- a/ash/wm/resize_shadow.h
+++ b/ash/wm/resize_shadow.h
@@ -8,7 +8,6 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/base/animation/animation_delegate.h"
namespace aura {
class Window;
@@ -18,19 +17,20 @@ class Rect;
}
namespace ui {
class Layer;
-class SlideAnimation;
}
namespace ash {
namespace internal {
+class ImageGrid;
+
// A class to render the resize edge effect when the user moves their mouse
// over a sizing edge. This is just a visual effect; the actual resize is
// handled by the EventFilter.
-class ResizeShadow : public ui::AnimationDelegate {
+class ResizeShadow {
public:
ResizeShadow();
- virtual ~ResizeShadow();
+ ~ResizeShadow();
// Initializes the resize effect layers for a given |window|.
void Init(aura::Window* window);
@@ -42,34 +42,16 @@ class ResizeShadow : public ui::AnimationDelegate {
// Hides all resize effects.
void Hide();
- // Updates the effect positions based on the |bounds| of its parent.
+ // Updates the effect positions based on the |bounds| of the window.
void Layout(const gfx::Rect& bounds);
- // ui::AnimationDelegate overrides:
- virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
-
private:
- void InitLayer(ui::Layer* parent, scoped_ptr<ui::Layer>* new_layer);
-
- void InitAnimation(scoped_ptr<ui::SlideAnimation>* animation);
-
- // Update the |opacity| for |layer| and sets the layer invisible if it is
- // completely transparent.
- void UpdateLayerOpacity(ui::Layer* layer, int opacity);
-
- // Layers of type LAYER_SOLID_COLOR for efficiency.
- scoped_ptr<ui::Layer> top_layer_;
- scoped_ptr<ui::Layer> left_layer_;
- scoped_ptr<ui::Layer> right_layer_;
- scoped_ptr<ui::Layer> bottom_layer_;
+ // Images for the shadow effect.
+ scoped_ptr<ImageGrid> image_grid_;
- // Slide animations for layer opacity.
- // TODO(jamescook): Switch to using ui::ScopedLayerAnimationSettings once
- // solid color layers support that for opacity.
- scoped_ptr<ui::SlideAnimation> top_animation_;
- scoped_ptr<ui::SlideAnimation> left_animation_;
- scoped_ptr<ui::SlideAnimation> right_animation_;
- scoped_ptr<ui::SlideAnimation> bottom_animation_;
+ // Hit test value from last call to ShowForHitTest(). Used to prevent
+ // repeatedly triggering the same animations for the same hit.
+ int last_hit_test_;
DISALLOW_COPY_AND_ASSIGN(ResizeShadow);
};