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

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

Issue 1550443002: Pushed InkDropHost inheritence up to CustomButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master Created 4 years, 11 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/custom_button.h ('k') | ui/views/controls/button/custom_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/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 5dab611315004990bc09fafb918353dc801460a4..3ab8303e9f8821d8dd77e1f7ba7308153cd78a60 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -333,6 +333,26 @@ void CustomButton::AnimationProgressed(const gfx::Animation* animation) {
}
////////////////////////////////////////////////////////////////////////////////
+// CustomButton, views::InkDropHost implementation:
+
+void CustomButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(false);
+ layer()->Add(ink_drop_layer);
+ layer()->StackAtBottom(ink_drop_layer);
+}
+
+void CustomButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+ layer()->Remove(ink_drop_layer);
+ SetFillsBoundsOpaquely(true);
+ SetPaintToLayer(false);
+}
+
+gfx::Point CustomButton::CalculateInkDropCenter() const {
+ return GetLocalBounds().CenterPoint();
+}
+
+////////////////////////////////////////////////////////////////////////////////
// CustomButton, protected:
CustomButton::CustomButton(ButtonListener* listener)
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/custom_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698