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

Unified Diff: content/browser/android/edge_effect.h

Issue 422013003: [Android] Use UIResource for overscroll glow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary layer disabling code 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/android/edge_effect.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/edge_effect.h
diff --git a/content/browser/android/edge_effect.h b/content/browser/android/edge_effect.h
index b8febba22d2a77673be3198c46b4e6d26cc39c21..a8f944c67acada5c73225bd9fd3e3f35120573d2 100644
--- a/content/browser/android/edge_effect.h
+++ b/content/browser/android/edge_effect.h
@@ -6,7 +6,7 @@
#define CONTENT_BROWSER_ANDROID_EDGE_EFFECT_H_
#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
#include "ui/gfx/size_f.h"
@@ -14,6 +14,10 @@ namespace cc {
class Layer;
}
+namespace ui {
+class SystemUIResourceManager;
+}
+
namespace content {
/* |EdgeEffect| mirrors its Android counterpart, EdgeEffect.java.
@@ -24,7 +28,7 @@ namespace content {
* All coordinates and dimensions are in device pixels.
*/
class EdgeEffect {
-public:
+ public:
enum Edge {
EDGE_TOP = 0,
EDGE_LEFT,
@@ -33,7 +37,7 @@ public:
EDGE_COUNT
};
- EdgeEffect(scoped_refptr<cc::Layer> edge, scoped_refptr<cc::Layer> glow);
+ explicit EdgeEffect(ui::SystemUIResourceManager* resource_manager);
~EdgeEffect();
void Pull(base::TimeTicks current_time, float delta_distance);
@@ -50,8 +54,11 @@ public:
float glow_height,
float offset);
-private:
+ void SetParent(cc::Layer* parent);
+
+ static void PreloadResources(ui::SystemUIResourceManager* resource_manager);
+ private:
enum State {
STATE_IDLE = 0,
STATE_PULL,
@@ -60,8 +67,9 @@ private:
STATE_PULL_DECAY
};
- scoped_refptr<cc::Layer> edge_;
- scoped_refptr<cc::Layer> glow_;
+ class EffectLayer;
+ scoped_ptr<EffectLayer> edge_;
+ scoped_ptr<EffectLayer> glow_;
float edge_alpha_;
float edge_scale_y_;
« no previous file with comments | « no previous file | content/browser/android/edge_effect.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698