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

Unified Diff: ash/app_list/app_list_presenter_delegate.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
« no previous file with comments | « ash/app_list/app_list_presenter_delegate.h ('k') | ash/ash.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/app_list/app_list_presenter_delegate.cc
diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc
index cefa08642861c0af1aef0db8342b882a684668c1..6d557d3b4d2e64a1872bd3ac3219cc88e30fcf06 100644
--- a/ash/app_list/app_list_presenter_delegate.cc
+++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -41,9 +41,17 @@ const int kMinimalAnchorPositionOffset = 57;
// Gets arrow location based on shelf alignment.
views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) {
DCHECK(Shell::HasInstance());
- return Shelf::ForWindow(window)->SelectValueForShelfAlignment(
- views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER,
- views::BubbleBorder::RIGHT_CENTER);
+ switch (Shelf::ForWindow(window)->alignment()) {
+ case SHELF_ALIGNMENT_BOTTOM:
+ case SHELF_ALIGNMENT_BOTTOM_LOCKED:
+ return views::BubbleBorder::BOTTOM_CENTER;
+ case SHELF_ALIGNMENT_LEFT:
+ return views::BubbleBorder::LEFT_CENTER;
+ case SHELF_ALIGNMENT_RIGHT:
+ return views::BubbleBorder::RIGHT_CENTER;
+ }
+ NOTREACHED();
+ return views::BubbleBorder::BOTTOM_CENTER;
}
// Using |button_bounds|, determine the anchor offset so that the bubble gets
@@ -254,10 +262,17 @@ gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset(
->GetShelfLayoutManager()
->UpdateAutoHideState();
- return Shelf::ForWindow(root_window)
- ->SelectValueForShelfAlignment(gfx::Vector2d(0, kAnimationOffset),
- gfx::Vector2d(-kAnimationOffset, 0),
- gfx::Vector2d(kAnimationOffset, 0));
+ switch (Shelf::ForWindow(root_window)->alignment()) {
+ case SHELF_ALIGNMENT_BOTTOM:
+ case SHELF_ALIGNMENT_BOTTOM_LOCKED:
+ return gfx::Vector2d(0, kAnimationOffset);
+ case SHELF_ALIGNMENT_LEFT:
+ return gfx::Vector2d(-kAnimationOffset, 0);
+ case SHELF_ALIGNMENT_RIGHT:
+ return gfx::Vector2d(kAnimationOffset, 0);
+ }
+ NOTREACHED();
+ return gfx::Vector2d();
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ash/app_list/app_list_presenter_delegate.h ('k') | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698