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

Unified Diff: ash/common/wm_shell.cc

Issue 2169533002: mash: Migrate shelf app list button to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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/common/wm_shell.h ('k') | ash/first_run/first_run_helper_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index cf87b86c42e8e718a1189627417a3a9c159ab4ff..54be0d08889a84c8be1c1ef2227a2f63d638eee5 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -9,6 +9,7 @@
#include "ash/common/accessibility_delegate.h"
#include "ash/common/focus_cycler.h"
#include "ash/common/keyboard/keyboard_ui.h"
+#include "ash/common/shelf/shelf_model.h"
#include "ash/common/shell_delegate.h"
#include "ash/common/shell_window_ids.h"
#include "ash/common/system/brightness_control_delegate.h"
@@ -22,6 +23,8 @@
#include "ash/common/wm_window.h"
#include "base/bind.h"
#include "base/logging.h"
+#include "ui/app_list/presenter/app_list_presenter.h"
+#include "ui/display/display.h"
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/brightness/brightness_controller_chromeos.h"
@@ -85,6 +88,7 @@ void WmShell::RemoveShellObserver(ShellObserver* observer) {
WmShell::WmShell(std::unique_ptr<ShellDelegate> shell_delegate)
: delegate_(std::move(shell_delegate)),
focus_cycler_(new FocusCycler),
+ shelf_model_(new ShelfModel),
system_tray_notifier_(new SystemTrayNotifier),
window_selector_controller_(new WindowSelectorController) {
#if defined(OS_CHROMEOS)
@@ -116,6 +120,32 @@ bool WmShell::IsSystemModalWindowOpen() {
return false;
}
+void WmShell::ShowAppList() {
+ // Show the app list on the default display for new windows.
+ int64_t display_id =
+ GetRootWindowForNewWindows()->GetDisplayNearestWindow().id();
+ delegate_->GetAppListPresenter()->Show(display_id);
+}
+
+void WmShell::DismissAppList() {
+ delegate_->GetAppListPresenter()->Dismiss();
+}
+
+void WmShell::ToggleAppList() {
+ // Show the app list on the default display for new windows.
+ int64_t display_id =
+ GetRootWindowForNewWindows()->GetDisplayNearestWindow().id();
+ delegate_->GetAppListPresenter()->ToggleAppList(display_id);
+}
+
+bool WmShell::IsApplistVisible() const {
+ return delegate_->GetAppListPresenter()->IsVisible();
+}
+
+bool WmShell::GetAppListTargetVisibility() const {
+ return delegate_->GetAppListPresenter()->GetTargetVisibility();
+}
+
void WmShell::SetKeyboardUI(std::unique_ptr<KeyboardUI> keyboard_ui) {
keyboard_ui_ = std::move(keyboard_ui);
}
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/first_run/first_run_helper_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698