Index: chrome/browser/ui/views/toolbar/toolbar_button.cc |
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
index 4a2e41a626aa82ea2a7cadb3326536c1d9c40d9e..8b89616bbec088967006241dd4d700a4653a64c1 100644 |
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc |
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc |
@@ -33,8 +33,19 @@ ToolbarButton::ToolbarButton(views::ButtonListener* listener, |
menu_showing_(false), |
y_position_on_lbuttondown_(0), |
show_menu_factory_(this) { |
+ // Sizes for the the ink drop. |
+ const int kInkDropLargeSize = 32; |
+ const int kInkDropLargeCornerRadius = 5; |
+ const int kInkDropSmallSize = 24; |
+ const int kInkDropSmallCornerRadius = 2; |
+ |
ink_drop_animation_controller_ = views::InkDropAnimationControllerFactory:: |
CreateInkDropAnimationController(this); |
+ ink_drop_animation_controller_->SetInkDropSize( |
+ gfx::Size(kInkDropLargeSize, kInkDropLargeSize), |
+ kInkDropLargeCornerRadius, |
+ gfx::Size(kInkDropSmallSize, kInkDropSmallSize), |
+ kInkDropSmallCornerRadius); |
set_context_menu_controller(this); |
} |
@@ -78,18 +89,6 @@ gfx::Size ToolbarButton::GetPreferredSize() const { |
void ToolbarButton::Layout() { |
LabelButton::Layout(); |
- |
- // Sizes for the the ink drop. |
- const int kInkDropLargeSize = 32; |
- const int kInkDropLargeCornerRadius = 5; |
- const int kInkDropSmallSize = 24; |
- const int kInkDropSmallCornerRadius = 2; |
- |
- ink_drop_animation_controller_->SetInkDropSize( |
- gfx::Size(kInkDropLargeSize, kInkDropLargeSize), |
- kInkDropLargeCornerRadius, |
- gfx::Size(kInkDropSmallSize, kInkDropSmallSize), |
- kInkDropSmallCornerRadius); |
ink_drop_animation_controller_->SetInkDropCenter(CalculateInkDropCenter()); |
} |
@@ -144,7 +143,8 @@ void ToolbarButton::OnMouseReleased(const ui::MouseEvent& event) { |
if (IsTriggerableEvent(event)) |
show_menu_factory_.InvalidateWeakPtrs(); |
- ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN); |
+ if (!HitTestPoint(event.location())) |
+ ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN); |
} |
void ToolbarButton::OnMouseCaptureLost() { |