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

Unified Diff: ash/common/wm_shell.cc

Issue 2739553005: Moves maintaining root_window_for_new_windows_ to Shell (Closed)
Patch Set: cleanup Created 3 years, 9 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/common/wm_shell.cc
diff --git a/ash/common/wm_shell.cc b/ash/common/wm_shell.cc
index 6e141731fb9ae84631e261e609c388fd2de94c4d..598e8e1c1b4bed6a5eda1abdb70dc53be85aee2a 100644
--- a/ash/common/wm_shell.cc
+++ b/ash/common/wm_shell.cc
@@ -60,7 +60,6 @@
#include "ui/app_list/presenter/app_list.h"
#include "ui/display/display.h"
#include "ui/views/focus/focus_manager_factory.h"
-#include "ui/wm/public/activation_client.h"
namespace ash {
@@ -114,8 +113,6 @@ void WmShell::Initialize(const scoped_refptr<base::SequencedWorkerPool>& pool) {
}
void WmShell::Shutdown() {
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
-
// These members access WmShell in their destructors.
wallpaper_controller_.reset();
accessibility_delegate_.reset();
@@ -298,12 +295,6 @@ RootWindowController* WmShell::GetPrimaryRootWindowController() {
return GetPrimaryRootWindow()->GetRootWindowController();
}
-WmWindow* WmShell::GetRootWindowForNewWindows() {
- if (scoped_root_window_for_new_windows_)
- return scoped_root_window_for_new_windows_;
- return root_window_for_new_windows_;
-}
-
bool WmShell::IsForceMaximizeOnFirstRun() {
return delegate()->IsForceMaximizeOnFirstRun();
}
@@ -354,7 +345,10 @@ void WmShell::OnModalWindowRemoved(WmWindow* removed) {
void WmShell::ShowAppList() {
// Show the app list on the default display for new windows.
- app_list_->Show(GetRootWindowForNewWindows()->GetDisplayNearestWindow().id());
+ app_list_->Show(Shell::GetInstance()
+ ->GetRootWindowForNewWindows()
+ ->GetDisplayNearestWindow()
+ .id());
}
void WmShell::DismissAppList() {
@@ -363,8 +357,10 @@ void WmShell::DismissAppList() {
void WmShell::ToggleAppList() {
// Toggle the app list on the default display for new windows.
- app_list_->ToggleAppList(
- GetRootWindowForNewWindows()->GetDisplayNearestWindow().id());
+ app_list_->ToggleAppList(Shell::GetInstance()
+ ->GetRootWindowForNewWindows()
+ ->GetDisplayNearestWindow()
+ .id());
}
bool WmShell::IsApplistVisible() const {
@@ -437,14 +433,4 @@ void WmShell::SessionStateChanged(session_manager::SessionState state) {
CreateShelfView();
}
-void WmShell::OnWindowActivated(
- aura::client::ActivationChangeObserver::ActivationReason reason,
- aura::Window* gained_active,
- aura::Window* lost_active) {
- // TODO(sky): Shell should implement ActivationChangeObserver, not WmShell.
- WmWindow* gained_active_wm = WmWindow::Get(gained_active);
- if (gained_active_wm)
- set_root_window_for_new_windows(gained_active_wm->GetRootWindow());
-}
-
} // namespace ash
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/drag_drop/drag_drop_tracker_unittest.cc » ('j') | ash/shell.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698