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

Unified Diff: chrome/browser/ui/views/bar_control_button.cc

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (moved ACTION_PENDING handling to toolbar_action_view for now) Created 5 years, 1 month 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
Index: chrome/browser/ui/views/bar_control_button.cc
diff --git a/chrome/browser/ui/views/bar_control_button.cc b/chrome/browser/ui/views/bar_control_button.cc
index 0e4336d5533964aabfe476257ce75bcf48ac4f9f..3b915af5e6dbf9aca76e3e49672dc23f4e198210 100644
--- a/chrome/browser/ui/views/bar_control_button.cc
+++ b/chrome/browser/ui/views/bar_control_button.cc
@@ -66,8 +66,7 @@ void BarControlButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
void BarControlButton::Layout() {
ImageButton::Layout();
- ink_drop_animation_controller_->SetInkDropCenter(
- GetLocalBounds().CenterPoint());
+ ink_drop_animation_controller_->SetInkDropCenter(CalculateInkDropCenter());
}
void BarControlButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
@@ -83,6 +82,10 @@ void BarControlButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
SetPaintToLayer(false);
}
+gfx::Point BarControlButton::CalculateInkDropCenter() const {
+ return GetLocalBounds().CenterPoint();
+}
+
bool BarControlButton::OnMousePressed(const ui::MouseEvent& event) {
if (IsTriggerableEvent(event)) {
ink_drop_animation_controller_->AnimateToState(

Powered by Google App Engine
This is Rietveld 408576698