Index: chrome/browser/ui/views/toolbar/app_menu_button.cc |
diff --git a/chrome/browser/ui/views/toolbar/app_menu_button.cc b/chrome/browser/ui/views/toolbar/app_menu_button.cc |
index fe81877bfa59310f01102317d29f51d45b635fbd..62bb1b8a1d2bc879e805869daa50926524756121 100644 |
--- a/chrome/browser/ui/views/toolbar/app_menu_button.cc |
+++ b/chrome/browser/ui/views/toolbar/app_menu_button.cc |
@@ -198,6 +198,13 @@ void AppMenuButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
SetPaintToLayer(false); |
} |
+gfx::Point AppMenuButton::CalculateInkDropCenter() const { |
+ // ToolbarView extends the bounds of the app button to the right in maximized |
+ // mode. So instead of using the center point of local bounds, we use the |
+ // center point of preferred size which doesn't change in maximized mode. |
+ return gfx::Rect(GetPreferredSize()).CenterPoint(); |
+} |
+ |
const char* AppMenuButton::GetClassName() const { |
return "AppMenuButton"; |
} |
@@ -225,12 +232,7 @@ bool AppMenuButton::CanDrop(const ui::OSExchangeData& data) { |
void AppMenuButton::Layout() { |
MenuButton::Layout(); |
- |
- // ToolbarView extends the bounds of the app button to the right in maximized |
- // mode. So instead of using the center point of local bounds, we use the |
- // center point of preferred size which doesn't change in maximized mode. |
- ink_drop_animation_controller_->SetInkDropCenter( |
- gfx::Rect(GetPreferredSize()).CenterPoint()); |
+ ink_drop_animation_controller_->SetInkDropCenter(CalculateInkDropCenter()); |
} |
void AppMenuButton::OnDragEntered(const ui::DropTargetEvent& event) { |