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

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: Added a comment about when it is appropriate to animate the launcher. Created 7 years 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 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 {
« no previous file with comments | « chrome/browser/ui/app_list/app_list_positioner.h ('k') | chrome/browser/ui/app_list/app_list_positioner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698