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

Unified Diff: ui/views/controls/button/custom_button.h

Issue 1478303003: Converted all Views to use an InkDropDelegate instead of a InkDropAnimationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed CustomButton::set_ink_drop_action_on_click() method. Created 5 years 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/animation/test/test_ink_drop_host.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.h
diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h
index 2f3508f453fb2536847deacccf41e29e8d288dba..2b3c35a23c6fa17c4d1f5b8ea985251a8f8bbd1e 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -8,6 +8,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/events/event_constants.h"
#include "ui/gfx/animation/animation_delegate.h"
+#include "ui/views/animation/ink_drop_state.h"
#include "ui/views/controls/button/button.h"
namespace gfx {
@@ -120,6 +121,10 @@ class VIEWS_EXPORT CustomButton : public Button,
// we simply return IsTriggerableEvent(event).
virtual bool ShouldEnterPushedState(const ui::Event& event);
+ void set_has_ink_drop_action_on_click(bool has_ink_drop_action_on_click) {
+ has_ink_drop_action_on_click_ = has_ink_drop_action_on_click;
+ }
+
// Returns true if the button should enter hovered state; that is, if the
// mouse is over the button, and no other window has capture (which would
// prevent the button from receiving MouseExited events and updating its
@@ -137,6 +142,10 @@ class VIEWS_EXPORT CustomButton : public Button,
const ViewHierarchyChangedDetails& details) override;
void OnBlur() override;
+ // Overridden from Button:
+ void NotifyClick(const ui::Event& event) override;
+ void OnClickCanceled(const ui::Event& event) override;
+
// The button state (defined in implementation)
ButtonState state_;
@@ -169,6 +178,15 @@ class VIEWS_EXPORT CustomButton : public Button,
// The event on which the button should notify its listener.
NotifyAction notify_action_;
+ // True when a button click should trigger an animation action on
+ // |ink_drop_delegate_|.
+ // TODO(bruthig): Use an InkDropAction enum and drop the flag.
+ bool has_ink_drop_action_on_click_;
+
+ // The animation action to trigger on the |ink_drop_delegate_| when the button
+ // is clicked.
+ InkDropState ink_drop_action_on_click_;
+
DISALLOW_COPY_AND_ASSIGN(CustomButton);
};
« no previous file with comments | « ui/views/animation/test/test_ink_drop_host.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698