| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ANDROID_EDGE_EFFECT_BASE_H_ | 5 #ifndef UI_ANDROID_EDGE_EFFECT_BASE_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_EDGE_EFFECT_BASE_H_ | 6 #define UI_ANDROID_EDGE_EFFECT_BASE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/gfx/geometry/size_f.h" | 10 #include "ui/gfx/geometry/size_f.h" |
| 11 #include "ui/gfx/transform.h" | 11 #include "ui/gfx/transform.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 class Layer; | 14 class Layer; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace ui { |
| 18 | 18 |
| 19 // A base class for overscroll-related Android effects. | 19 // A base class for overscroll-related Android effects. |
| 20 class EdgeEffectBase { | 20 class EdgeEffectBase { |
| 21 public: | 21 public: |
| 22 enum State { | 22 enum State { |
| 23 STATE_IDLE = 0, | 23 STATE_IDLE = 0, |
| 24 STATE_PULL, | 24 STATE_PULL, |
| 25 STATE_ABSORB, | 25 STATE_ABSORB, |
| 26 STATE_RECEDE, | 26 STATE_RECEDE, |
| 27 STATE_PULL_DECAY | 27 STATE_PULL_DECAY |
| (...skipping 27 matching lines...) Expand all Loading... |
| 55 const gfx::SizeF& viewport_size, | 55 const gfx::SizeF& viewport_size, |
| 56 float offset); | 56 float offset); |
| 57 | 57 |
| 58 // Computes the maximum effect size relative to the screen |edge|. For | 58 // Computes the maximum effect size relative to the screen |edge|. For |
| 59 // top/bottom edges, thsi is simply |viewport_size|, while for left/right | 59 // top/bottom edges, thsi is simply |viewport_size|, while for left/right |
| 60 // edges this is |viewport_size| with coordinates swapped. | 60 // edges this is |viewport_size| with coordinates swapped. |
| 61 static gfx::SizeF ComputeOrientedSize(Edge edge, | 61 static gfx::SizeF ComputeOrientedSize(Edge edge, |
| 62 const gfx::SizeF& viewport_size); | 62 const gfx::SizeF& viewport_size); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 } // namespace content | 65 } // namespace ui |
| 66 | 66 |
| 67 #endif // CONTENT_BROWSER_ANDROID_EDGE_EFFECT_BASE_H_ | 67 #endif // UI_ANDROID_EDGE_EFFECT_BASE_H_ |
| OLD | NEW |