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

Unified Diff: ash/shell.cc

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Sync and rebase. Created 3 years, 7 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
« ash/shell.h ('K') | « ash/shell.h ('k') | ash/shell_port.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 2d36d457672a27fa6712ce10fb719013481a9b5a..1a7e00a5792c1f84ab91ee1c9ec752400aefee5b 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -269,18 +269,12 @@ RootWindowController* Shell::GetRootWindowControllerWithDisplayId(
// static
aura::Window* Shell::GetPrimaryRootWindow() {
CHECK(HasInstance());
- return instance_->shell_port_->GetPrimaryRootWindow()->aura_window();
+ return instance_->shell_port_->GetPrimaryRootWindow();
}
// static
aura::Window* Shell::GetRootWindowForNewWindows() {
CHECK(Shell::HasInstance());
- return WmWindow::GetAuraWindow(Shell::GetWmRootWindowForNewWindows());
-}
-
-// static
-WmWindow* Shell::GetWmRootWindowForNewWindows() {
- CHECK(Shell::HasInstance());
Shell* shell = Shell::Get();
if (shell->scoped_root_window_for_new_windows_)
return shell->scoped_root_window_for_new_windows_;
@@ -464,8 +458,9 @@ void Shell::RemoveShellObserver(ShellObserver* observer) {
void Shell::ShowAppList() {
// Show the app list on the default display for new windows.
- app_list_->Show(
- GetWmRootWindowForNewWindows()->GetDisplayNearestWindow().id());
+ app_list_->Show(display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(GetRootWindowForNewWindows())
+ .id());
}
void Shell::DismissAppList() {
@@ -475,7 +470,9 @@ void Shell::DismissAppList() {
void Shell::ToggleAppList() {
// Toggle the app list on the default display for new windows.
app_list_->ToggleAppList(
- GetWmRootWindowForNewWindows()->GetDisplayNearestWindow().id());
+ display::Screen::GetScreen()
+ ->GetDisplayNearestWindow(GetRootWindowForNewWindows())
+ .id());
}
bool Shell::IsAppListVisible() const {
@@ -940,7 +937,7 @@ void Shell::Init(const ShellInitParams& init_params) {
screen_position_controller_.reset(new ScreenPositionController);
shell_port_->CreatePrimaryHost();
- root_window_for_new_windows_ = WmWindow::Get(GetPrimaryRootWindow());
+ root_window_for_new_windows_ = GetPrimaryRootWindow();
if (config != Config::MASH) {
resolution_notification_controller_.reset(
@@ -1227,9 +1224,8 @@ void Shell::OnWindowActivated(
aura::client::ActivationChangeObserver::ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) {
- WmWindow* gained_active_wm = WmWindow::Get(gained_active);
- if (gained_active_wm)
- root_window_for_new_windows_ = gained_active_wm->GetRootWindow();
+ if (gained_active)
+ root_window_for_new_windows_ = gained_active->GetRootWindow();
}
void Shell::OnSessionStateChanged(session_manager::SessionState state) {
« ash/shell.h ('K') | « ash/shell.h ('k') | ash/shell_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698