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

Unified Diff: ash/app_list/app_list_presenter_delegate.cc

Issue 2939693004: Added HALF, FULLSCREEN_ALL_APPS, and FULLSCREEN_SEARCH. (Closed)
Patch Set: Addressed comments. Created 3 years, 6 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/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..8c56f0f8ecaf9c59b6250d30b34b83db12463a93 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());
if (!app_list::features::IsFullscreenAppListEnabled()) {
view->MaybeSetAnchorPoint(GetCenterOfDisplayForWindow(
@@ -166,6 +167,27 @@ gfx::Vector2d AppListPresenterDelegate::GetVisibilityAnimationOffset(
return gfx::Vector2d();
}
+bool AppListPresenterDelegate::IsMaximizeModeActive() const {
+ MaximizeModeController* maximize_mode_controller =
+ Shell::Get()->maximize_mode_controller();
+ return maximize_mode_controller &&
oshima 2017/06/13 22:26:04 maximize_mode_controller should never be null. Th
newcomer 2017/06/13 23:00:39 Thanks! Done.
+ maximize_mode_controller->IsMaximizeModeWindowManagerEnabled();
+}
+
+bool AppListPresenterDelegate::IsSideShelf() const {
+ aura::Window* root_window =
+ RootWindowController::ForTargetRootWindow()->GetRootWindow();
xiyuan 2017/06/13 21:38:58 This does not look right for multi-display case. T
newcomer 2017/06/13 22:22:47 Done.
+ 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;
+ }
oshima 2017/06/13 22:26:04 don't you need return?
newcomer 2017/06/13 23:00:39 The return statements are in the switch. I refacto
+}
+
////////////////////////////////////////////////////////////////////////////////
// AppListPresenterDelegate, private:
@@ -229,4 +251,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

Powered by Google App Engine
This is Rietveld 408576698