| Index: chrome/browser/ui/app_list/app_list_positioner.cc
|
| diff --git a/chrome/browser/ui/app_list/app_list_positioner.cc b/chrome/browser/ui/app_list/app_list_positioner.cc
|
| index 72b5068dd4bd272263fdad6531fe5206e5dba895..968b53ac105f58bd8661cecd518686c5a3e8a783 100644
|
| --- a/chrome/browser/ui/app_list/app_list_positioner.cc
|
| +++ b/chrome/browser/ui/app_list/app_list_positioner.cc
|
| @@ -81,6 +81,33 @@ gfx::Point AppListPositioner::GetAnchorPointForShelfCorner(
|
| return ClampAnchorPoint(anchor);
|
| }
|
|
|
| +gfx::Point AppListPositioner::GetAnchorPointForShelfCenter(
|
| + ScreenEdge shelf_edge) const {
|
| + const gfx::Rect& work_area = display_.work_area();
|
| + gfx::Point anchor;
|
| + switch (shelf_edge) {
|
| + case SCREEN_EDGE_LEFT:
|
| + anchor =
|
| + gfx::Point(work_area.x(), work_area.y() + work_area.height() / 2);
|
| + break;
|
| + case SCREEN_EDGE_RIGHT:
|
| + anchor =
|
| + gfx::Point(work_area.right(), work_area.y() + work_area.height() / 2);
|
| + break;
|
| + case SCREEN_EDGE_TOP:
|
| + anchor = gfx::Point(work_area.x() + work_area.width() / 2, work_area.y());
|
| + break;
|
| + case SCREEN_EDGE_BOTTOM:
|
| + anchor =
|
| + gfx::Point(work_area.x() + work_area.width() / 2, work_area.bottom());
|
| + break;
|
| + default:
|
| + NOTREACHED();
|
| + anchor = gfx::Point();
|
| + }
|
| + return ClampAnchorPoint(anchor);
|
| +}
|
| +
|
| gfx::Point AppListPositioner::GetAnchorPointForShelfCursor(
|
| ScreenEdge shelf_edge,
|
| const gfx::Point& cursor) const {
|
|
|