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

Unified Diff: ash/shell.cc

Issue 2194353002: mash: Migrate ScopedTargetRootWindow to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: non-virtual Created 4 years, 4 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/shell.h ('k') | ash/wm/window_cycle_controller_unittest.cc » ('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 2023521916431442158d56ee44d17c98a36b6c2c..19e8665e0893f0cdedf6ebeefa4f0bb4dbe5ae05 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -236,11 +236,9 @@ aura::Window* Shell::GetPrimaryRootWindow() {
// static
aura::Window* Shell::GetTargetRootWindow() {
- CHECK(HasInstance());
- Shell* shell = GetInstance();
- if (shell->scoped_target_root_window_)
- return shell->scoped_target_root_window_;
- return shell->target_root_window_;
+ CHECK(WmShell::HasInstance());
+ return WmWindowAura::GetAuraWindow(
+ WmShell::Get()->GetRootWindowForNewWindows());
}
// static
@@ -541,8 +539,6 @@ void Shell::DoInitialWorkspaceAnimation() {
Shell::Shell(ShellDelegate* delegate, base::SequencedWorkerPool* blocking_pool)
: wm_shell_(new WmShellAura(base::WrapUnique(delegate))),
- target_root_window_(nullptr),
- scoped_target_root_window_(nullptr),
link_handler_model_factory_(nullptr),
activation_client_(nullptr),
#if defined(OS_CHROMEOS)
@@ -828,7 +824,6 @@ void Shell::Init(const ShellInitParams& init_params) {
new ::wm::FocusController(focus_rules);
focus_client_.reset(focus_controller);
activation_client_ = focus_controller;
- activation_client_->AddObserver(this);
screen_position_controller_.reset(new ScreenPositionController);
@@ -836,7 +831,7 @@ void Shell::Init(const ShellInitParams& init_params) {
window_tree_host_manager_->CreatePrimaryHost(
ShellInitParamsToAshWindowTreeHostInitParams(init_params));
aura::Window* root_window = window_tree_host_manager_->GetPrimaryRootWindow();
- target_root_window_ = root_window;
+ wm_shell_->set_root_window_for_new_windows(WmWindowAura::Get(root_window));
#if defined(OS_CHROMEOS)
resolution_notification_controller_.reset(
@@ -1083,15 +1078,4 @@ ui::EventTargeter* Shell::GetEventTargeter() {
return nullptr;
}
-////////////////////////////////////////////////////////////////////////////////
-// Shell, aura::client::ActivationChangeObserver implementation:
-
-void Shell::OnWindowActivated(
- aura::client::ActivationChangeObserver::ActivationReason reason,
- aura::Window* gained_active,
- aura::Window* lost_active) {
- if (gained_active)
- target_root_window_ = gained_active->GetRootWindow();
-}
-
} // namespace ash
« no previous file with comments | « ash/shell.h ('k') | ash/wm/window_cycle_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698