Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ash / wm / resize_shadow.h
blobd9f24520be9fe0da8c202c12e6fdd28cad412b46
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
3 // found in the LICENSE file.
5 #ifndef ASH_WM_RESIZE_SHADOW_H_
6 #define ASH_WM_RESIZE_SHADOW_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
11 namespace aura {
12 class Window;
14 namespace gfx {
15 class Rect;
17 namespace ui {
18 class Layer;
20 namespace views {
21 namespace corewm {
22 class ImageGrid;
26 namespace ash {
27 namespace internal {
29 // A class to render the resize edge effect when the user moves their mouse
30 // over a sizing edge. This is just a visual effect; the actual resize is
31 // handled by the EventFilter.
32 class ResizeShadow {
33 public:
34 ResizeShadow();
35 ~ResizeShadow();
37 // Initializes the resize effect layers for a given |window|.
38 void Init(aura::Window* window);
40 // Shows resize effects for one or more edges based on a |hit_test| code, such
41 // as HTRIGHT or HTBOTTOMRIGHT.
42 void ShowForHitTest(int hit_test);
44 // Hides all resize effects.
45 void Hide();
47 // Updates the effect positions based on the |bounds| of the window.
48 void Layout(const gfx::Rect& bounds);
50 private:
51 // Images for the shadow effect.
52 scoped_ptr<views::corewm::ImageGrid> image_grid_;
54 // Hit test value from last call to ShowForHitTest(). Used to prevent
55 // repeatedly triggering the same animations for the same hit.
56 int last_hit_test_;
58 DISALLOW_COPY_AND_ASSIGN(ResizeShadow);
61 } // namespace internal
62 } // namespace ash
64 #endif // ASH_WM_RESIZE_SHADOW_H_