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..1880c2c19564c906925fd042b72dfb9447ad6c21 100644 |
--- a/ash/app_list/app_list_presenter_delegate.cc |
+++ b/ash/app_list/app_list_presenter_delegate.cc |
@@ -58,6 +58,23 @@ gfx::Point GetCenterOfDisplayForWindow(aura::Window* window, |
return bounds.CenterPoint(); |
} |
+// Whether the shelf is oriented on the side, not on the bottom. |
+bool IsSideShelf(aura::Window* root_window) { |
+ bool is_side_shelf = false; |
+ Shelf* shelf = Shelf::ForWindow(root_window); |
+ switch (shelf->alignment()) { |
+ case SHELF_ALIGNMENT_BOTTOM: |
+ case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
+ is_side_shelf = false; |
oshima
2017/06/15 17:51:45
nit: just return false, true in swich. no need to
newcomer
2017/06/15 18:20:26
Done.
|
+ break; |
+ case SHELF_ALIGNMENT_LEFT: |
+ case SHELF_ALIGNMENT_RIGHT: |
+ is_side_shelf = true; |
+ break; |
+ } |
+ return is_side_shelf; |
oshima
2017/06/15 17:51:45
then return false;
newcomer
2017/06/15 18:20:26
Moved all return statements into the switch statem
|
+} |
+ |
} // namespace |
//////////////////////////////////////////////////////////////////////////////// |
@@ -98,7 +115,11 @@ 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, |
+ Shell::Get() |
+ ->maximize_mode_controller() |
+ ->IsMaximizeModeWindowManagerEnabled(), |
+ IsSideShelf(root_window)); |
if (!app_list::features::IsFullscreenAppListEnabled()) { |
view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow( |
@@ -229,4 +250,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 |