OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_AURA_WINDOW_SLIDER_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_AURA_WINDOW_SLIDER_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_AURA_WINDOW_SLIDER_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_AURA_WINDOW_SLIDER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // The WindowSlider takes ownership of the created layer. | 39 // The WindowSlider takes ownership of the created layer. |
40 virtual ui::Layer* CreateFrontLayer() = 0; | 40 virtual ui::Layer* CreateFrontLayer() = 0; |
41 | 41 |
42 // Called when the slide is aborted. Note that when the slide is aborted, | 42 // Called when the slide is aborted. Note that when the slide is aborted, |
43 // the WindowSlider resets any transform it applied on the window-layer. | 43 // the WindowSlider resets any transform it applied on the window-layer. |
44 virtual void OnWindowSlideAborted() = 0; | 44 virtual void OnWindowSlideAborted() = 0; |
45 | 45 |
46 // Called when the slide is about to be complete. The delegate can take | 46 // Called when the slide is about to be complete. The delegate can take |
47 // action with the assumption that slide will complete soon (within the | 47 // action with the assumption that slide will complete soon (within the |
48 // duration of the final transition animation effect). | 48 // duration of the final transition animation effect). |
49 // This callback is always preceeded by CreateBackLayerAndSetAsTarget() or | 49 // This callback is always preceeded by CreateBackLayer() or by |
50 // by CreateFrontLayerAndSetAsTarget() callback, and is guaranteed to be | 50 // CreateFrontLayer() callback, and is guaranteed to be followed by the |
51 // followed by the OnWindowSlideCompleted() callback. | 51 // OnWindowSlideCompleted() callback. |
52 virtual void OnWindowSlideCompleting() = 0; | 52 virtual void OnWindowSlideCompleting() = 0; |
53 | 53 |
54 // Called when the window slide completes. Note that at the end the | 54 // Called when the window slide completes. Note that at the end the |
55 // window-layer may have been transformed. The callback here should reset | 55 // window-layer may have been transformed. The callback here should reset |
56 // the transform if necessary. | 56 // the transform if necessary. |layer| is the slider's layer (previously |
57 virtual void OnWindowSlideCompleted() = 0; | 57 // created via CreateBackLayer() or CreateFrontLayer()). |
| 58 virtual void OnWindowSlideCompleted(scoped_ptr<ui::Layer> layer) = 0; |
58 | 59 |
59 // Called when the slider is destroyed. | 60 // Called when the slider is destroyed. |
60 virtual void OnWindowSliderDestroyed() = 0; | 61 virtual void OnWindowSliderDestroyed() = 0; |
61 }; | 62 }; |
62 | 63 |
63 // The WindowSlider slides the layers in the |owner| window. It starts | 64 // The WindowSlider slides the layers in the |owner| window. It starts |
64 // intercepting scroll events on |event_window|, and uses those events to | 65 // intercepting scroll events on |event_window|, and uses those events to |
65 // control the layer-slide. The lifetime of the slider is managed by the | 66 // control the layer-slide. The lifetime of the slider is managed by the |
66 // lifetime of |owner|, i.e. if |owner| is destroyed, then the slider also | 67 // lifetime of |owner|, i.e. if |owner| is destroyed, then the slider also |
67 // destroys itself. | 68 // destroys itself. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 const float start_threshold_touchscreen_; | 147 const float start_threshold_touchscreen_; |
147 const float start_threshold_touchpad_; | 148 const float start_threshold_touchpad_; |
148 const float complete_threshold_; | 149 const float complete_threshold_; |
149 | 150 |
150 DISALLOW_COPY_AND_ASSIGN(WindowSlider); | 151 DISALLOW_COPY_AND_ASSIGN(WindowSlider); |
151 }; | 152 }; |
152 | 153 |
153 } // namespace content | 154 } // namespace content |
154 | 155 |
155 #endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_WINDOW_SLIDER_H_ | 156 #endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_WINDOW_SLIDER_H_ |
OLD | NEW |