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

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 (nits 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
« no previous file with comments | « ui/views/controls/button/menu_button.h ('k') | ui/views/scoped_target_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..22a79ae12406380cd91ab0a68ea8d6184d0f64c0 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,8 @@ bool MenuButton::Activate() {
// We don't set our state here. It's handled in the MenuController code or
// by our click listener.
+ if (ink_drop_delegate())
+ ink_drop_delegate()->OnAction(InkDropState::QUICK_ACTION);
listener_->OnMenuButtonClicked(this, menu_position);
if (destroyed) {
@@ -189,6 +192,8 @@ void MenuButton::OnMouseReleased(const ui::MouseEvent& event) {
HitTestPoint(event.location()) && !InDrag()) {
Activate();
} else {
+ if (ink_drop_delegate())
+ ink_drop_delegate()->OnAction(InkDropState::HIDDEN);
LabelButton::OnMouseReleased(event);
}
}
« no previous file with comments | « ui/views/controls/button/menu_button.h ('k') | ui/views/scoped_target_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698