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

Unified Diff: ui/views/controls/button/menu_button.cc

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (moved ACTION_PENDING handling to toolbar_action_view for now) Created 5 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
Index: ui/views/controls/button/menu_button.cc
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index 1225e67f5057482bc8db59bf65543a12a7f14603..bc2371c31410d324fc8fc858a0d90ca8c0bb08f6 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -18,6 +18,7 @@
#include "ui/gfx/text_constants.h"
#include "ui/resources/grit/ui_resources.h"
#include "ui/strings/grit/ui_strings.h"
+#include "ui/views/animation/ink_drop_delegate.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/menu_button_listener.h"
#include "ui/views/mouse_constants.h"
@@ -126,6 +127,7 @@ bool MenuButton::Activate() {
// We don't set our state here. It's handled in the MenuController code or
// by our click listener.
+ GetInkDropDelegate()->OnAction(InkDropState::QUICK_ACTION);
listener_->OnMenuButtonClicked(this, menu_position);
if (destroyed) {
@@ -145,12 +147,6 @@ bool MenuButton::Activate() {
return true;
}
-void MenuButton::WillNotActivate() {
- if (listener_) {
- listener_->OnMenuButtonClickCanceled(this);
- }
-}
-
void MenuButton::OnPaint(gfx::Canvas* canvas) {
LabelButton::OnPaint(canvas);
@@ -195,7 +191,7 @@ void MenuButton::OnMouseReleased(const ui::MouseEvent& event) {
HitTestPoint(event.location()) && !InDrag()) {
Activate();
} else {
- WillNotActivate();
+ GetInkDropDelegate()->OnAction(InkDropState::HIDDEN);
LabelButton::OnMouseReleased(event);
}
}

Powered by Google App Engine
This is Rietveld 408576698