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

Unified Diff: ash/wm/window_animations.cc

Issue 2228713003: mash: Convert ShelfView to wm common types, clean up Shelf access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix control reaches end of non-void function warnings Created 4 years, 4 months 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: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index b39896b620edd628124588d8b63807806436a8a4..77024956054399758947f800a641cae8fdf10309 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -482,10 +482,17 @@ gfx::Rect GetMinimizeAnimationTargetBoundsInScreen(aura::Window* window) {
gfx::Rect work_area =
display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area();
int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x();
- return shelf->SelectValueForShelfAlignment(
- gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0),
- gfx::Rect(work_area.x(), work_area.y(), 0, 0),
- gfx::Rect(work_area.right(), work_area.y(), 0, 0));
+ switch (shelf->alignment()) {
+ case SHELF_ALIGNMENT_BOTTOM:
+ case SHELF_ALIGNMENT_BOTTOM_LOCKED:
+ return gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0);
+ case SHELF_ALIGNMENT_LEFT:
+ return gfx::Rect(work_area.x(), work_area.y(), 0, 0);
+ case SHELF_ALIGNMENT_RIGHT:
+ return gfx::Rect(work_area.right(), work_area.y(), 0, 0);
+ }
+ NOTREACHED();
+ return gfx::Rect();
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698