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

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

Issue 377013002: android: Use UIResource for overscroll glow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 6 years, 5 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..50dbc6b529c16b875e68c18981db776c8e074b67 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,14 @@ namespace content {
* All coordinates and dimensions are in device pixels.
*/
class EdgeEffect {
-public:
+ public:
+ class LayerWrapper {
+ public:
+ virtual cc::Layer* layer() = 0;
+ virtual void AddToLayer(cc::Layer* parent) = 0;
jdduke (slow) 2014/07/17 19:56:51 Looks like you can also just forward decl this cla
powei 2014/07/21 21:25:58 Done.
+ virtual ~LayerWrapper() {}
+ };
+
enum Edge {
EDGE_TOP = 0,
EDGE_LEFT,
@@ -33,7 +44,7 @@ public:
EDGE_COUNT
};
- EdgeEffect(scoped_refptr<cc::Layer> edge, scoped_refptr<cc::Layer> glow);
+ EdgeEffect(ui::SystemUIResourceManager* resource_manager);
~EdgeEffect();
void Pull(base::TimeTicks current_time, float delta_distance);
@@ -50,6 +61,8 @@ public:
float glow_height,
float offset);
+ void AddEffectsToLayer(cc::Layer* parent);
jdduke (slow) 2014/07/17 19:56:51 Nitty nit: Let's either call this |AddToLayer()|,
powei 2014/07/21 21:25:58 Done.
+
private:
enum State {
@@ -60,8 +73,8 @@ private:
STATE_PULL_DECAY
};
- scoped_refptr<cc::Layer> edge_;
- scoped_refptr<cc::Layer> glow_;
+ scoped_ptr<LayerWrapper> edge_;
+ scoped_ptr<LayerWrapper> 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