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

Unified Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2272793005: ash: Move alignment and autohide behavior from Shelf to WmShelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments 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 | « no previous file | ash/common/shelf/shelf.h » ('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 0bd692dd850906b7178db451fca4771d89fc4244..c7e8c91b1ecc46e0a449749b00c031588dec679b 100644
--- a/ash/app_list/app_list_presenter_delegate.cc
+++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -44,7 +44,8 @@ const int kMinimalAnchorPositionOffset = 57;
// Gets arrow location based on shelf alignment.
views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) {
DCHECK(Shell::HasInstance());
- switch (Shelf::ForWindow(WmWindowAura::Get(window))->alignment()) {
+ WmShelf* shelf = Shelf::ForWindow(WmWindowAura::Get(window))->wm_shelf();
+ switch (shelf->alignment()) {
case SHELF_ALIGNMENT_BOTTOM:
case SHELF_ALIGNMENT_BOTTOM_LOCKED:
return views::BubbleBorder::BOTTOM_CENTER;
@@ -64,6 +65,7 @@ gfx::Vector2d GetAnchorPositionOffsetToShelf(const gfx::Rect& button_bounds,
DCHECK(Shell::HasInstance());
ShelfAlignment shelf_alignment =
Shelf::ForWindow(WmLookup::Get()->GetWindowForWidget(widget))
+ ->wm_shelf()
->alignment();
gfx::Point anchor(button_bounds.CenterPoint());
switch (shelf_alignment) {
@@ -259,7 +261,7 @@ gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset(
Shelf* shelf = Shelf::ForWindow(WmWindowAura::Get(root_window));
shelf->shelf_layout_manager()->UpdateAutoHideState();
- switch (shelf->alignment()) {
+ switch (shelf->wm_shelf()->alignment()) {
case SHELF_ALIGNMENT_BOTTOM:
case SHELF_ALIGNMENT_BOTTOM_LOCKED:
return gfx::Vector2d(0, kAnimationOffset);
« no previous file with comments | « no previous file | ash/common/shelf/shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698