Chromium Code Reviews| 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 fc81a0ab465a3c04fea5fb455ba19c0594ed625a..759e8b959dfb1454c223896f73bb5b883aeade0e 100644 |
| --- a/ash/app_list/app_list_presenter_delegate.cc |
| +++ b/ash/app_list/app_list_presenter_delegate.cc |
| @@ -98,7 +98,8 @@ void AppListPresenterDelegate::Init(app_list::AppListView* view, |
| aura::Window* container = RootWindowController::ForWindow(root_window) |
| ->GetContainer(kShellWindowId_AppListContainer); |
| - view->Initialize(container, current_apps_page); |
| + view->Initialize(container, current_apps_page, IsMaximizeModeActive(), |
| + IsSideShelf(root_window)); |
|
vadimt
2017/06/13 18:14:10
Would it be too expensive to calculate root_window
newcomer
2017/06/13 18:51:45
Done.
|
| if (!app_list::features::IsFullscreenAppListEnabled()) { |
| view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow( |
| @@ -166,6 +167,25 @@ gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset( |
| return gfx::Vector2d(); |
| } |
| +bool AppListPresenterDelegate::IsMaximizeModeActive() { |
| + MaximizeModeController* maximize_mode_controller = |
| + Shell::Get()->maximize_mode_controller(); |
| + return maximize_mode_controller && |
|
vadimt
2017/06/13 18:14:10
Can it realistically be null?
newcomer
2017/06/13 18:51:45
I copied that function from https://cs.chromium.or
|
| + maximize_mode_controller->IsMaximizeModeWindowManagerEnabled(); |
| +} |
| + |
| +bool AppListPresenterDelegate::IsSideShelf(aura::Window* root_window) { |
| + Shelf* shelf = Shelf::ForWindow(root_window); |
| + switch (shelf->alignment()) { |
| + case SHELF_ALIGNMENT_BOTTOM: |
| + case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
| + return false; |
| + case SHELF_ALIGNMENT_LEFT: |
| + case SHELF_ALIGNMENT_RIGHT: |
| + return true; |
| + } |
| +} |
| + |
| //////////////////////////////////////////////////////////////////////////////// |
| // AppListPresenterDelegate, private: |
| @@ -229,4 +249,18 @@ void AppListPresenterDelegate::OnOverviewModeStarting() { |
| presenter_->Dismiss(); |
| } |
| +void AppListPresenterDelegate::OnMaximizeModeStarted() { |
| + if (!app_list::features::IsFullscreenAppListEnabled()) |
| + return; |
| + |
| + view_->OnMaximizeModeChanged(true); |
| +} |
| + |
| +void AppListPresenterDelegate::OnMaximizeModeEnded() { |
| + if (!app_list::features::IsFullscreenAppListEnabled()) |
| + return; |
| + |
| + view_->OnMaximizeModeChanged(false); |
| +} |
| + |
| } // namespace ash |