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..a910125e8da888e1ba990ead9a5517ddfddde4f7 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 preferred size which doesn't |
Peter Kasting
2015/11/24 20:42:00
Nit: preferred size which -> the preferred size, w
varkha
2015/11/24 21:50:43
Done.
|
+ // 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) { |