Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: chrome/browser/ui/app_list/app_list_positioner.cc

Issue 93863002: Mac App Launcher is positioned on center of dock in certain cases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Goddamn Reitveld. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698