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

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 (comments in ui/views/) 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 5603548ba337ab554a5e288b4a3ec353172c7297..59d104cc2bcf1a21601226ffa316f71077814c96 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.
+ ink_drop_delegate()->OnAction(InkDropState::QUICK_ACTION);
listener_->OnMenuButtonClicked(this, menu_position);
if (destroyed) {
@@ -189,6 +191,7 @@ void MenuButton::OnMouseReleased(const ui::MouseEvent& event) {
HitTestPoint(event.location()) && !InDrag()) {
Activate();
} else {
+ ink_drop_delegate()->OnAction(InkDropState::HIDDEN);
LabelButton::OnMouseReleased(event);
}
}

Powered by Google App Engine
This is Rietveld 408576698