OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 CONTENT_BROWSER_WEB_CONTENTS_AURA_OVERSCROLL_LAYER_WRAPPER_H_ | |
6 #define CONTENT_BROWSER_WEB_CONTENTS_AURA_OVERSCROLL_LAYER_WRAPPER_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "ui/gfx/geometry/rect.h" | |
10 #include "ui/gfx/image/image.h" | |
11 #include "ui/gfx/transform.h" | |
12 | |
13 namespace aura { | |
14 class Window; | |
15 } | |
16 | |
17 namespace ui { | |
18 class Layer; | |
19 class LayerAnimator; | |
20 } | |
21 | |
22 namespace content { | |
23 | |
24 class ImageLayerDelegate; | |
25 class ShadowLayerDelegate; | |
26 | |
27 // Wraps a window or a layer, exposing some of their common API to allow | |
28 // overscroll animations for both cases. | |
29 class OverscrollLayerWrapper { | |
mfomitchev
2015/02/27 21:33:42
Perhaps we don't need this - perhaps OWA could alw
Nina
2015/03/09 15:54:52
Ack, for now we decided to keep the wrapper.
| |
30 public: | |
31 // The contructor takes ownership of the overscroll window. | |
32 OverscrollLayerWrapper(); | |
33 | |
34 ~OverscrollLayerWrapper(); | |
35 | |
36 // Wrap the given window or layer. For a given instance of | |
37 // OverscrollLayerWrapper, only call one of these, once. | |
38 void WrapWindow(aura::Window* window); | |
mfomitchev
2015/02/27 21:33:42
Just put these into constr
Nina
2015/03/09 15:54:52
Done.
| |
39 void WrapLayer(ui::Layer* layer); | |
40 | |
41 // Applies the |transform| to the wrapped target. | |
42 void SetTransform(const gfx::Transform& transform); | |
43 | |
44 // Sets the bounds of the wrapped target. | |
45 void SetBounds(const gfx::Rect& bounds); | |
46 | |
47 // Returns the wrapped target layer animator. | |
48 ui::LayerAnimator* GetAnimator(); | |
49 | |
50 // Returns the wrapped target layer bounds. | |
51 gfx::Rect GetBounds(); | |
52 | |
53 private: | |
54 // The wrapped layer. | |
55 ui::Layer* layer_; | |
mfomitchev
2015/02/27 21:33:42
Perhaps make it own window/layer and have ONO/WCVA
Nina
2015/03/09 15:54:52
I would love to, but by doing that we would lose t
| |
56 | |
57 // The wrapped window. | |
58 aura::Window* window_; | |
59 | |
60 // Shadow shown under the animated layer. | |
61 scoped_ptr<ShadowLayerDelegate> shadow_; | |
62 }; | |
63 | |
64 } // namespace content | |
65 | |
66 #endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_OVERSCROLL_LAYER_WRAPPER_H_ | |
OLD | NEW |