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

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

Issue 2041033002: Moved ButtonInkDropDelegate logic into InkDropHostView and deleted InkDropDelegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed merge conflict in custom_button.cc Created 4 years, 6 months 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/md_text_button.cc ('k') | ui/views/controls/button/menu_button_unittest.cc » ('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 3602b45bc9cfbe483d28189ef9b6c93d3f8aed56..d5796b0e21cbe0c402aeed7b88f916582080ef8a 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -18,7 +18,6 @@
#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"
@@ -148,10 +147,8 @@ bool MenuButton::Activate(const ui::Event* event) {
menu_closed_time_ = TimeTicks::Now();
- if (ink_drop_delegate() && !increment_pressed_lock_called &&
- pressed_lock_count_ == 0) {
- ink_drop_delegate()->OnAction(InkDropState::ACTION_TRIGGERED);
- }
+ if (!increment_pressed_lock_called && pressed_lock_count_ == 0)
+ AnimateInkDrop(InkDropState::ACTION_TRIGGERED);
// We must return false here so that the RootView does not get stuck
// sending all mouse pressed events to us instead of the appropriate
@@ -159,8 +156,7 @@ bool MenuButton::Activate(const ui::Event* event) {
return false;
}
- if (ink_drop_delegate())
- ink_drop_delegate()->OnAction(InkDropState::HIDDEN);
+ AnimateInkDrop(InkDropState::HIDDEN);
return true;
}
@@ -226,8 +222,7 @@ void MenuButton::OnMouseReleased(const ui::MouseEvent& event) {
HitTestPoint(event.location()) && !InDrag()) {
Activate(&event);
} else {
- if (ink_drop_delegate())
- ink_drop_delegate()->OnAction(InkDropState::HIDDEN);
+ AnimateInkDrop(InkDropState::HIDDEN);
LabelButton::OnMouseReleased(event);
}
}
@@ -377,11 +372,11 @@ void MenuButton::IncrementPressedLocked(bool snap_ink_drop_to_activated) {
if (increment_pressed_lock_called_)
*increment_pressed_lock_called_ = true;
should_disable_after_press_ = state() == STATE_DISABLED;
- if (state() != STATE_PRESSED && ink_drop_delegate()) {
+ if (state() != STATE_PRESSED) {
if (snap_ink_drop_to_activated)
- ink_drop_delegate()->SnapToActivated();
+ ink_drop()->SnapToActivated();
else
- ink_drop_delegate()->OnAction(InkDropState::ACTIVATED);
+ AnimateInkDrop(InkDropState::ACTIVATED);
}
SetState(STATE_PRESSED);
}
@@ -400,8 +395,8 @@ void MenuButton::DecrementPressedLocked() {
desired_state = STATE_HOVERED;
}
SetState(desired_state);
- if (ink_drop_delegate() && state() != STATE_PRESSED)
- ink_drop_delegate()->OnAction(InkDropState::DEACTIVATED);
+ if (state() != STATE_PRESSED)
+ AnimateInkDrop(InkDropState::DEACTIVATED);
}
}
« no previous file with comments | « ui/views/controls/button/md_text_button.cc ('k') | ui/views/controls/button/menu_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698