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

Unified Diff: ash/common/system/tray/actionable_view.cc

Issue 2457393006: [ash-md] Added ink drop to system menu rows that inherit from ActionableView. (Closed)
Patch Set: Fixed the failing test: 'SpokenFeedbackTest.NavigateSystemTray' 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/actionable_view.h ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/actionable_view.cc
diff --git a/ash/common/system/tray/actionable_view.cc b/ash/common/system/tray/actionable_view.cc
index b53f49f31e11e809af21ee48a5ef969971059c69..77c7433d637763f6b62a54cf60fa9348386314e5 100644
--- a/ash/common/system/tray/actionable_view.cc
+++ b/ash/common/system/tray/actionable_view.cc
@@ -10,6 +10,7 @@
#include "ash/common/system/tray/tray_constants.h"
#include "ui/accessibility/ax_view_state.h"
#include "ui/gfx/canvas.h"
+#include "ui/gfx/geometry/rect_f.h"
#include "ui/views/animation/flood_fill_ink_drop_ripple.h"
#include "ui/views/animation/ink_drop_highlight.h"
@@ -22,6 +23,7 @@ ActionableView::ActionableView(SystemTrayItem* owner)
: views::CustomButton(this), destroyed_(nullptr), owner_(owner) {
SetFocusBehavior(FocusBehavior::ALWAYS);
set_has_ink_drop_action_on_click(false);
+ set_notify_enter_exit_on_child(true);
}
ActionableView::~ActionableView() {
@@ -78,6 +80,23 @@ void ActionableView::OnBlur() {
SchedulePaint();
}
+std::unique_ptr<views::InkDropRipple> ActionableView::CreateInkDropRipple()
+ const {
+ return base::MakeUnique<views::FloodFillInkDropRipple>(
+ GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(),
+ kTrayPopupInkDropBaseColor, kTrayPopupInkDropRippleOpacity);
+}
+
+std::unique_ptr<views::InkDropHighlight>
+ActionableView::CreateInkDropHighlight() const {
+ std::unique_ptr<views::InkDropHighlight> highlight(
+ new views::InkDropHighlight(size(), 0,
+ gfx::RectF(GetLocalBounds()).CenterPoint(),
+ kTrayPopupInkDropBaseColor));
+ highlight->set_visible_opacity(kTrayPopupInkDropHighlightOpacity);
+ return highlight;
+}
+
void ActionableView::CloseSystemBubble() {
DCHECK(owner_);
owner_->system_tray()->CloseSystemBubble();
« no previous file with comments | « ash/common/system/tray/actionable_view.h ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698