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

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: Fixed whitespace in toolbar_action_view.h 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/image_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.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 62fec14cbce91d26834649fe869231a99e9dbf97..db3fb5d7937355a3e247158834c9800bb7b3183f 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -331,6 +331,26 @@ void CustomButton::AnimationProgressed(const gfx::Animation* animation) {
}
////////////////////////////////////////////////////////////////////////////////
+// CustomButton, views::InkDropHost implementation:
+
+void CustomButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(false);
sadrul 2016/01/06 19:18:45 It shouldn't happen here. At most, this should DCH
+ 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/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698