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

Unified Diff: ash/system/tray/tray_background_view.h

Issue 251193004: Animate the OverviewButtonTray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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/system/tray/tray_background_view.h
diff --git a/ash/system/tray/tray_background_view.h b/ash/system/tray/tray_background_view.h
index 365e63a05d308f2275a88420718dda459f899254..7c141a3679fe229a37e46627d9f4f99db81c514d 100644
--- a/ash/system/tray/tray_background_view.h
+++ b/ash/system/tray/tray_background_view.h
@@ -9,8 +9,13 @@
#include "ash/shelf/background_animator.h"
#include "ash/shelf/shelf_types.h"
#include "ash/system/tray/actionable_view.h"
+#include "ui/gfx/animation/animation_delegate.h"
#include "ui/views/bubble/tray_bubble_view.h"
+namespace gfx {
+class SlideAnimation;
+} // namespace gfx
+
namespace ash {
class ShelfLayoutManager;
class StatusAreaWidget;
@@ -18,12 +23,13 @@ class TrayEventFilter;
class TrayBackground;
// Base class for children of StatusAreaWidget: SystemTray, WebNotificationTray,
-// LogoutButtonTray.
+// LogoutButtonTray, OverviewButtonTray.
// This class handles setting and animating the background when the Launcher
// his shown/hidden. It also inherits from ActionableView so that the tray
// items can override PerformAction when clicked on.
class ASH_EXPORT TrayBackgroundView : public ActionableView,
- public BackgroundAnimatorDelegate {
+ public BackgroundAnimatorDelegate,
+ public gfx::AnimationDelegate {
public:
static const char kViewClassName[];
@@ -38,11 +44,11 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
void set_size(const gfx::Size& size) { size_ = size; }
- // Overridden from views::View.
+ // views::View:
virtual gfx::Size GetPreferredSize() OVERRIDE;
protected:
- // Overridden from views::View.
+ // views::View:
virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;
virtual void ChildVisibilityChanged(View* child) OVERRIDE;
virtual void ViewHierarchyChanged(
@@ -63,7 +69,10 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// Called after the tray has been added to the widget containing it.
virtual void Initialize();
- // Overridden from views::View.
+ // views::View:
+ virtual void SetVisible(bool visible) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual int GetHeightForWidth(int width) OVERRIDE;
virtual const char* GetClassName() const OVERRIDE;
virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
@@ -71,11 +80,11 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
virtual void AboutToRequestFocusFromTabTraversal(bool reverse) OVERRIDE;
- // Overridden from ActionableView.
+ // ActionableView:
virtual bool PerformAction(const ui::Event& event) OVERRIDE;
virtual gfx::Rect GetFocusBounds() OVERRIDE;
- // Overridden from BackgroundAnimatorDelegate.
+ // BackgroundAnimatorDelegate:
virtual void UpdateBackground(int alpha) OVERRIDE;
// Called whenever the shelf alignment changes.
@@ -148,10 +157,21 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
private:
class TrayWidgetObserver;
+ friend class OverviewButtonTrayTest;
+ friend class SystemTrayTest;
+ friend class WebNotificationTrayTest;
+
// Called from Initialize after all status area trays have been created.
// Sets the border based on the position of the view.
void SetTrayBorder();
+ static void DisableAnimationsForTest();
+
+ // gfx::AnimationDelegate:
+ virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
+ virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
+
// Unowned pointer to parent widget.
StatusAreaWidget* status_area_widget_;
@@ -177,6 +197,7 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
scoped_ptr<TrayWidgetObserver> widget_observer_;
scoped_ptr<TrayEventFilter> tray_event_filter_;
+ scoped_ptr<gfx::SlideAnimation> animation_;
DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView);
};

Powered by Google App Engine
This is Rietveld 408576698