Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / browser / android / edge_effect_base.h
blobf7df20dfe16c7b3954418f716fa0f471f9d09b5e
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_ANDROID_EDGE_EFFECT_BASE_H_
6 #define CONTENT_BROWSER_ANDROID_EDGE_EFFECT_BASE_H_
8 #include "base/basictypes.h"
9 #include "base/time/time.h"
10 #include "ui/gfx/geometry/size_f.h"
11 #include "ui/gfx/transform.h"
13 namespace cc {
14 class Layer;
17 namespace content {
19 // A base class for overscroll-related Android effects.
20 class EdgeEffectBase {
21 public:
22 enum State {
23 STATE_IDLE = 0,
24 STATE_PULL,
25 STATE_ABSORB,
26 STATE_RECEDE,
27 STATE_PULL_DECAY
30 virtual ~EdgeEffectBase() {}
32 virtual void Pull(base::TimeTicks current_time,
33 float delta_distance,
34 float displacement) = 0;
35 virtual void Absorb(base::TimeTicks current_time, float velocity) = 0;
36 virtual bool Update(base::TimeTicks current_time) = 0;
37 virtual void Release(base::TimeTicks current_time) = 0;
39 virtual void Finish() = 0;
40 virtual bool IsFinished() const = 0;
42 virtual void ApplyToLayers(const gfx::SizeF& size,
43 const gfx::Transform& transform) = 0;
44 virtual void SetParent(cc::Layer* parent) = 0;
47 } // namespace content
49 #endif // CONTENT_BROWSER_ANDROID_EDGE_EFFECT_BASE_H_