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

Unified Diff: ash/shelf/shelf_view.h

Issue 2053113002: Replaced BackgroundAnimator with ShelfBackgroundAnimator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made the ShelfView add/remove itself as an observer from the ShelfBackgroundAnimator. Created 4 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: ash/shelf/shelf_view.h
diff --git a/ash/shelf/shelf_view.h b/ash/shelf/shelf_view.h
index 0bbc33470c88040b827d5d3158aa884e1e42ed92..1b95501b34e290c8ab53c22edd59b8ee9d33b507 100644
--- a/ash/shelf/shelf_view.h
+++ b/ash/shelf/shelf_view.h
@@ -11,6 +11,7 @@
#include <vector>
#include "ash/common/shelf/ink_drop_button_listener.h"
+#include "ash/common/shelf/shelf_background_animator_observer.h"
#include "ash/common/shelf/shelf_item_delegate.h"
#include "ash/common/shelf/shelf_model_observer.h"
#include "ash/shelf/shelf_button_pressed_metric_tracker.h"
@@ -44,6 +45,7 @@ class OverflowBubble;
class OverflowButton;
class ScopedTargetRootWindow;
class Shelf;
+class ShelfBackgroundAnimator;
class ShelfButton;
class ShelfDelegate;
class ShelfIconObserver;
@@ -61,6 +63,7 @@ extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT;
extern const int SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT;
class ASH_EXPORT ShelfView : public views::View,
+ public ShelfBackgroundAnimatorObserver,
public ShelfModelObserver,
public InkDropButtonListener,
public views::ContextMenuController,
@@ -71,7 +74,8 @@ class ASH_EXPORT ShelfView : public views::View,
ShelfView(ShelfModel* model,
ShelfDelegate* delegate,
WmShelf* wm_shelf,
- Shelf* shelf);
+ Shelf* shelf,
+ ShelfBackgroundAnimator* background_animator);
~ShelfView() override;
Shelf* shelf() const { return shelf_; }
@@ -282,6 +286,9 @@ class ASH_EXPORT ShelfView : public views::View,
// Overridden from ui::EventHandler:
void OnGestureEvent(ui::GestureEvent* event) override;
+ // ShelfBackgroundAnimatorObserver:
+ void UpdateShelfItemBackground(int alpha) override;
+
// Overridden from ShelfModelObserver:
void ShelfItemAdded(int model_index) override;
void ShelfItemRemoved(int model_index, ShelfID id) override;
@@ -467,6 +474,9 @@ class ASH_EXPORT ShelfView : public views::View,
// Tracks UMA metrics based on shelf button press actions.
ShelfButtonPressedMetricTracker shelf_button_pressed_metric_tracker_;
+ // The background animator to observe. Can be null.
+ ShelfBackgroundAnimator* background_animator_;
+
DISALLOW_COPY_AND_ASSIGN(ShelfView);
};

Powered by Google App Engine
This is Rietveld 408576698