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

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

Issue 2499453002: Add ink drop ripple to overview mode button (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 | « ash/common/system/tray/system_tray_unittest.cc ('k') | ash/common/system/tray/tray_background_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_background_view.h
diff --git a/ash/common/system/tray/tray_background_view.h b/ash/common/system/tray/tray_background_view.h
index b642ca692d688ae12e4acb071bea3796d18a2891..4197403af2d6682e1e1f96255a1e86dcf70287a2 100644
--- a/ash/common/system/tray/tray_background_view.h
+++ b/ash/common/system/tray/tray_background_view.h
@@ -78,8 +78,9 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
void OnPaint(gfx::Canvas* canvas) override;
// ActionableView:
- bool PerformAction(const ui::Event& event) override;
- gfx::Rect GetFocusBounds() override;
+ std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
+ std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
+ const override;
void OnGestureEvent(ui::GestureEvent* event) override;
// Called whenever the shelf alignment changes.
@@ -105,8 +106,10 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// Sets |contents| as a child.
void SetContents(views::View* contents);
- // Creates and sets contents background to |background_|.
- void SetContentsBackground();
+ // Creates and sets contents background to |background_|. |draws_active|
+ // determines if the view's background should be drawn as active when the view
+ // is in the active state.
+ void SetContentsBackground(bool draws_active);
// Returns the anchor rect for the bubble.
gfx::Rect GetBubbleAnchorRect(
@@ -117,11 +120,8 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// Returns the bubble anchor alignment based on |shelf_alignment_|.
views::TrayBubbleView::AnchorAlignment GetAnchorAlignment() const;
- // Forces the background to be drawn active if set to true.
- void SetDrawBackgroundAsActive(bool visible);
-
- // Returns true when the the background was overridden to be drawn as active.
- bool draw_background_as_active() const { return draw_background_as_active_; }
+ void SetIsActive(bool is_active);
+ bool is_active() const { return is_active_; }
TrayContainer* tray_container() const { return tray_container_; }
ShelfAlignment shelf_alignment() const { return shelf_alignment_; }
@@ -137,6 +137,14 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// Updates the visibility of this tray's separator.
void SetSeparatorVisibility(bool is_show);
+ protected:
+ // ActionableView:
+ bool ShouldEnterPushedState(const ui::Event& event) override;
+ bool PerformAction(const ui::Event& event) override;
+ void HandlePerformActionResult(bool action_performed,
+ const ui::Event& event) override;
+ gfx::Rect GetFocusBounds() override;
+
private:
class TrayWidgetObserver;
@@ -161,9 +169,9 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// Owned by the view passed to SetContents().
TrayBackground* background_;
- // This variable stores the activation override which will tint the background
- // differently if set to true.
- bool draw_background_as_active_;
+ // Determines if the view is active. This changes how the background is drawn
+ // in non-MD version and how the ink drop ripples behave in MD version.
+ bool is_active_;
// Visibility of this tray's separator which is a line of 1x32px and 4px to
// right of tray.
« no previous file with comments | « ash/common/system/tray/system_tray_unittest.cc ('k') | ash/common/system/tray/tray_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698