Index: chrome/browser/ui/views/app_list/win/app_list_win.cc |
diff --git a/chrome/browser/ui/views/app_list/win/app_list_win.cc b/chrome/browser/ui/views/app_list/win/app_list_win.cc |
index 85b86e03aa0380be22d078d5abd5d7ed9d38524f..f2d4e820b655dcb67411ad94786acec1ac8ef8d5 100644 |
--- a/chrome/browser/ui/views/app_list/win/app_list_win.cc |
+++ b/chrome/browser/ui/views/app_list/win/app_list_win.cc |
@@ -46,7 +46,8 @@ bool GetTaskbarRect(gfx::Rect* rect) { |
gfx::Point AppListWin::FindAnchorPoint(const gfx::Size& view_size, |
const gfx::Display& display, |
const gfx::Point& cursor, |
- const gfx::Rect& taskbar_rect) { |
+ const gfx::Rect& taskbar_rect, |
+ bool center_window) { |
AppListPositioner positioner(display, view_size, kMinDistanceFromEdge); |
// Subtract the taskbar area since the display's default work_area will not |
@@ -55,7 +56,7 @@ gfx::Point AppListWin::FindAnchorPoint(const gfx::Size& view_size, |
positioner.WorkAreaSubtract(taskbar_rect); |
// Special case for app list in the center of the screen. |
- if (app_list::switches::IsCenteredAppListEnabled()) |
+ if (center_window) |
return positioner.GetAnchorPointForScreenCenter(); |
// Find which edge of the screen the taskbar is attached to. |
@@ -86,6 +87,9 @@ void AppListWin::MoveNearCursor(app_list::AppListView* view) { |
view->SetBubbleArrow(views::BubbleBorder::FLOAT); |
gfx::Rect taskbar_rect; |
GetTaskbarRect(&taskbar_rect); |
- view->SetAnchorPoint( |
- FindAnchorPoint(view->GetPreferredSize(), display, cursor, taskbar_rect)); |
+ view->SetAnchorPoint(FindAnchorPoint(view->GetPreferredSize(), |
+ display, |
+ cursor, |
+ taskbar_rect, |
+ view->ShouldCenterWindow())); |
} |