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 bca918dde15b0032e60a10732195ac498688d31c..6a1e4882c198b6471421f539d58a03aa209f853b 100644 |
--- a/chrome/browser/ui/views/toolbar/app_menu_button.cc |
+++ b/chrome/browser/ui/views/toolbar/app_menu_button.cc |
@@ -211,6 +211,17 @@ 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 (adjusted for RTL layouts) of the preferred size, which |
+ // doesn't change in maximized mode. |
+ const int visible_width = GetPreferredSize().width(); |
+ return gfx::Point( |
+ (GetMirroredXWithWidthInView(0, visible_width) + visible_width) / 2, |
+ height() / 2); |
+} |
+ |
const char* AppMenuButton::GetClassName() const { |
return "AppMenuButton"; |
} |
@@ -259,15 +270,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 (adjusted for RTL layouts) of preferred size which doesn't |
- // change in maximized mode. |
- const int visible_width = GetPreferredSize().width(); |
- ink_drop_animation_controller_->SetInkDropCenter(gfx::Point( |
- (GetMirroredXWithWidthInView(0, visible_width) + visible_width) / 2, |
- height() / 2)); |
+ ink_drop_animation_controller_->SetInkDropCenter(CalculateInkDropCenter()); |
} |
void AppMenuButton::OnDragEntered(const ui::DropTargetEvent& event) { |