OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/bar_control_button.h" | 5 #include "chrome/browser/ui/views/bar_control_button.h" |
6 | 6 |
7 #include "ui/gfx/color_utils.h" | 7 #include "ui/gfx/color_utils.h" |
8 #include "ui/gfx/paint_vector_icon.h" | 8 #include "ui/gfx/paint_vector_icon.h" |
9 #include "ui/gfx/vector_icons_public.h" | 9 #include "ui/gfx/vector_icons_public.h" |
10 #include "ui/views/animation/ink_drop_animation_controller.h" | 10 #include "ui/views/animation/ink_drop_animation_controller.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 } | 64 } |
65 | 65 |
66 void BarControlButton::Layout() { | 66 void BarControlButton::Layout() { |
67 ImageButton::Layout(); | 67 ImageButton::Layout(); |
68 | 68 |
69 ink_drop_animation_controller_->SetInkDropCenter( | 69 ink_drop_animation_controller_->SetInkDropCenter( |
70 GetLocalBounds().CenterPoint()); | 70 GetLocalBounds().CenterPoint()); |
71 } | 71 } |
72 | 72 |
73 void BarControlButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 73 void BarControlButton::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
74 // TODO(estade|tdanderson): The ink drop layer should be positioned behind | |
75 // the button's image. | |
tdanderson
2015/11/18 16:14:17
BarControlButton extends ImageButton, which does n
jonross
2015/11/18 16:36:52
We can follow the pattern used for CircleLayerDele
Peter Kasting
2015/11/18 21:04:53
I recall proposing that we try to use it more wide
tdanderson
2015/11/19 15:15:42
Thanks for the suggestion; I will address this in
| |
74 SetPaintToLayer(true); | 76 SetPaintToLayer(true); |
75 SetFillsBoundsOpaquely(false); | 77 SetFillsBoundsOpaquely(false); |
76 layer()->Add(ink_drop_layer); | 78 layer()->Add(ink_drop_layer); |
77 layer()->StackAtBottom(ink_drop_layer); | 79 layer()->StackAtBottom(ink_drop_layer); |
78 } | 80 } |
79 | 81 |
80 void BarControlButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 82 void BarControlButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
81 layer()->Remove(ink_drop_layer); | 83 layer()->Remove(ink_drop_layer); |
82 SetFillsBoundsOpaquely(true); | 84 SetFillsBoundsOpaquely(true); |
83 SetPaintToLayer(false); | 85 SetPaintToLayer(false); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 | 130 |
129 ImageButton::OnMouseReleased(event); | 131 ImageButton::OnMouseReleased(event); |
130 } | 132 } |
131 | 133 |
132 void BarControlButton::NotifyClick(const ui::Event& event) { | 134 void BarControlButton::NotifyClick(const ui::Event& event) { |
133 ink_drop_animation_controller_->AnimateToState( | 135 ink_drop_animation_controller_->AnimateToState( |
134 views::InkDropState::QUICK_ACTION); | 136 views::InkDropState::QUICK_ACTION); |
135 | 137 |
136 ImageButton::NotifyClick(event); | 138 ImageButton::NotifyClick(event); |
137 } | 139 } |
OLD | NEW |