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

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

Issue 377013002: android: Use UIResource for overscroll glow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. moved resource loading to its own class. 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
Index: content/browser/android/overscroll_glow.h
diff --git a/content/browser/android/overscroll_glow.h b/content/browser/android/overscroll_glow.h
index 0a555d41b7af8ac39c87889b4d36099bca796680..6154a64feed9c3e26dc4ecb5b0d961e949aa4f7b 100644
--- a/content/browser/android/overscroll_glow.h
+++ b/content/browser/android/overscroll_glow.h
@@ -18,19 +18,30 @@ namespace cc {
class Layer;
}
+namespace ui {
+class SystemUIResourceManager;
+}
+
namespace content {
+// A wrapper class over the cc::Layer.
+class OverscrollGlowLayerWrapper {
jdduke (slow) 2014/07/12 01:01:09 Could we have EdgeEffect define this interface (in
powei 2014/07/16 17:10:52 Done.
+ public:
+ virtual scoped_refptr<cc::Layer> layer() = 0;
jdduke (slow) 2014/07/12 01:01:09 What about just returning a naked pointer?
powei 2014/07/16 17:10:51 Done.
+ virtual ~OverscrollGlowLayerWrapper() {}
+};
+
/* |OverscrollGlow| mirrors its Android counterpart, OverscrollGlow.java.
* Conscious tradeoffs were made to align this as closely as possible with the
* original Android Java version.
*/
class OverscrollGlow {
public:
- // Create a new effect. If |enabled| is false, the effect will remain
- // deactivated until explicitly enabled.
- // Note: No resources will be allocated until the effect is both
- // enabled and an overscroll event has occurred.
- static scoped_ptr<OverscrollGlow> Create(bool enabled);
+ // Create a new effect. WindowAndroid provides the resource for the effect.
jdduke (slow) 2014/07/12 01:01:09 Hmm, did you mean to reference WindowAndroid inste
powei 2014/07/16 17:10:52 Done.
+ // If |enabled| is false, the effect will remain deactivated until explicitly
+ // enabled.
+ static scoped_ptr<OverscrollGlow> Create(
+ ui::SystemUIResourceManager* resource_manager);
~OverscrollGlow();
@@ -70,7 +81,7 @@ class OverscrollGlow {
private:
enum Axis { AXIS_X, AXIS_Y };
- OverscrollGlow(bool enabled);
+ OverscrollGlow(ui::SystemUIResourceManager* resource_manager);
// Returns whether the effect is initialized.
bool InitializeIfNecessary();
@@ -94,6 +105,7 @@ class OverscrollGlow {
bool initialized_;
scoped_refptr<cc::Layer> root_layer_;
+ ui::SystemUIResourceManager* resource_manager_;
DISALLOW_COPY_AND_ASSIGN(OverscrollGlow);
};

Powered by Google App Engine
This is Rietveld 408576698