Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: content/browser/android/edge_effect_l.h

Issue 367173003: [Android] Implementation of overscroll effect for Android L (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Write event location through DidOverscrollParams Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_BROWSER_ANDROID_EDGE_EFFECT_L_H_
6 #define CONTENT_BROWSER_ANDROID_EDGE_EFFECT_L_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/browser/android/edge_effect_base.h"
11 #include "ui/gfx/geometry/rect_f.h"
12 #include "ui/gfx/geometry/size.h"
13
14 namespace cc {
15 class Layer;
16 class UIResourceLayer;
17 }
18
19 namespace ui {
20 class SystemUIResourceManager;
21 }
22
23 namespace content {
24
25 // |EdgeEffectL| mirrors its Android L counterpart, EdgeEffect.java.
26 // Conscious tradeoffs were made to align this as closely as possible with the
27 // the original Android java version.
28 // All coordinates and dimensions are in device pixels.
29 class EdgeEffectL : public EdgeEffectBase {
30 public:
31 explicit EdgeEffectL(ui::SystemUIResourceManager* resource_manager);
32 virtual ~EdgeEffectL();
33
34 virtual void Pull(base::TimeTicks current_time,
35 float delta_distance) OVERRIDE;
36 virtual void Pull(base::TimeTicks current_time,
37 float delta_distance,
38 float displacement) OVERRIDE;
39 virtual void Absorb(base::TimeTicks current_time, float velocity) OVERRIDE;
40 virtual bool Update(base::TimeTicks current_time) OVERRIDE;
41 virtual void Release(base::TimeTicks current_time) OVERRIDE;
42
43 virtual void Finish() OVERRIDE;
44 virtual bool IsFinished() const OVERRIDE;
45
46 virtual void ApplyToLayers(const gfx::SizeF& size,
47 const gfx::Transform& transform) OVERRIDE;
48 virtual void SetParent(cc::Layer* parent) OVERRIDE;
49
50 // Thread-safe trigger to load resources.
51 static void PreloadResources(ui::SystemUIResourceManager* resource_manager);
52
53 private:
54 ui::SystemUIResourceManager* const resource_manager_;
55
56 scoped_refptr<cc::UIResourceLayer> glow_;
57
58 float glow_alpha_;
59 float glow_scale_y_;
60
61 float glow_alpha_start_;
62 float glow_alpha_finish_;
63 float glow_scale_y_start_;
64 float glow_scale_y_finish_;
65
66 gfx::RectF arc_rect_;
67 gfx::Size bounds_;
68 float displacement_;
69 float target_displacement_;
70
71 base::TimeTicks start_time_;
72 base::TimeDelta duration_;
73
74 State state_;
75
76 float pull_distance_;
77
78 DISALLOW_COPY_AND_ASSIGN(EdgeEffectL);
79 };
80
81 } // namespace content
82
83 #endif // CONTENT_BROWSER_ANDROID_EDGE_EFFECT_L_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698