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

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

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/actionable_view.h ('k') | ash/common/system/tray/system_tray.cc » ('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 157db84c56522e816b2f1d0f23e57749a6131648..ed961a63edc94e81480a5c755639f822924109bb 100644
--- a/ash/common/system/tray/actionable_view.cc
+++ b/ash/common/system/tray/actionable_view.cc
@@ -24,6 +24,8 @@ const char ActionableView::kViewClassName[] = "tray/ActionableView";
ActionableView::ActionableView(SystemTrayItem* owner)
: views::CustomButton(this), destroyed_(nullptr), owner_(owner) {
SetFocusBehavior(FocusBehavior::ALWAYS);
+ set_ink_drop_base_color(kTrayPopupInkDropBaseColor);
+ set_ink_drop_visible_opacity(kTrayPopupInkDropRippleOpacity);
set_has_ink_drop_action_on_click(false);
set_notify_enter_exit_on_child(true);
}
@@ -43,6 +45,13 @@ gfx::Rect ActionableView::GetFocusBounds() {
return GetLocalBounds();
}
+void ActionableView::HandlePerformActionResult(bool action_performed,
+ const ui::Event& event) {
+ AnimateInkDrop(action_performed ? views::InkDropState::ACTION_TRIGGERED
+ : views::InkDropState::HIDDEN,
+ ui::LocatedEvent::FromIfValid(&event));
+}
+
const char* ActionableView::GetClassName() const {
return kViewClassName;
}
@@ -93,7 +102,7 @@ std::unique_ptr<views::InkDropRipple> ActionableView::CreateInkDropRipple()
const {
return base::MakeUnique<views::FloodFillInkDropRipple>(
GetLocalBounds(), GetInkDropCenterBasedOnLastEvent(),
- kTrayPopupInkDropBaseColor, kTrayPopupInkDropRippleOpacity);
+ GetInkDropBaseColor(), ink_drop_visible_opacity());
}
std::unique_ptr<views::InkDropHighlight>
@@ -101,7 +110,7 @@ ActionableView::CreateInkDropHighlight() const {
std::unique_ptr<views::InkDropHighlight> highlight(
new views::InkDropHighlight(size(), 0,
gfx::RectF(GetLocalBounds()).CenterPoint(),
- kTrayPopupInkDropBaseColor));
+ GetInkDropBaseColor()));
highlight->set_visible_opacity(kTrayPopupInkDropHighlightOpacity);
return highlight;
}
@@ -119,13 +128,7 @@ void ActionableView::ButtonPressed(Button* sender, const ui::Event& event) {
return;
destroyed_ = nullptr;
- if (action_performed) {
- AnimateInkDrop(views::InkDropState::ACTION_TRIGGERED,
- ui::LocatedEvent::FromIfValid(&event));
- } else {
- AnimateInkDrop(views::InkDropState::HIDDEN,
- ui::LocatedEvent::FromIfValid(&event));
- }
+ HandlePerformActionResult(action_performed, event);
}
ButtonListenerActionableView::ButtonListenerActionableView(
« no previous file with comments | « ash/common/system/tray/actionable_view.h ('k') | ash/common/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698