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 090020245fdae007351854b8adc2691a2ddc7f70..435a332d89c6841b956d2f5b2011bf2d4ca2307e 100644 |
--- a/chrome/browser/ui/app_list/app_list_positioner.cc |
+++ b/chrome/browser/ui/app_list/app_list_positioner.cc |
@@ -81,6 +81,35 @@ gfx::Point AppListPositioner::GetAnchorPointForShelfCorner( |
return ClampAnchorPoint(anchor); |
} |
+gfx::Point AppListPositioner::GetAnchorPointForShelfCenter( |
+ ScreenEdge shelf_edge) const { |
+ const gfx::Rect& screen_rect = display_.bounds(); |
+ const gfx::Rect& work_area = display_.work_area(); |
+ gfx::Point anchor; |
+ switch (shelf_edge) { |
+ case SCREEN_EDGE_LEFT: |
+ anchor = gfx::Point(work_area.x(), |
+ screen_rect.y() + screen_rect.height() / 2); |
tapted
2013/11/29 02:12:51
Maybe s/screen_rect/work_area? My left dock looks
Matt Giuca
2013/11/29 05:24:08
Done.
|
+ break; |
+ case SCREEN_EDGE_RIGHT: |
+ anchor = gfx::Point(work_area.right(), |
+ screen_rect.y() + screen_rect.height() / 2); |
+ break; |
+ case SCREEN_EDGE_TOP: |
tapted
2013/11/29 02:12:51
Do we need this? I'm not sure if consistency outwe
Matt Giuca
2013/11/29 05:24:08
I think that would be a Bad Idea. This is a genera
tapted
2013/11/29 06:05:59
I see the rationale for adding the case statement
Matt Giuca
2013/12/02 05:02:03
No, there aren't (although there are probably Linu
|
+ anchor = gfx::Point(screen_rect.x() + screen_rect.width() / 2, |
+ work_area.y()); |
+ break; |
+ case SCREEN_EDGE_BOTTOM: |
+ anchor = gfx::Point(screen_rect.x() + screen_rect.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 { |