Index: ash/mus/bridge/shell_port_mash.cc |
diff --git a/ash/mus/bridge/shell_port_mash.cc b/ash/mus/bridge/shell_port_mash.cc |
index 46c4bc9f4474e2c4fed949add5f8dba31662f4cc..acd2757da9600fc2e44700de7ed22f4a849c1d58 100644 |
--- a/ash/mus/bridge/shell_port_mash.cc |
+++ b/ash/mus/bridge/shell_port_mash.cc |
@@ -136,8 +136,7 @@ void ShellPortMash::Shutdown() { |
ShellPort::Shutdown(); |
- // TODO(sky): Config::MASH should use WindowTreeHostManager too. |
- if (GetAshConfig() == Config::MUS) |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) |
Shell::Get()->window_tree_host_manager()->Shutdown(); |
else |
window_manager_->DeleteAllRootWindowControllers(); |
@@ -148,7 +147,7 @@ Config ShellPortMash::GetAshConfig() const { |
} |
aura::Window* ShellPortMash::GetPrimaryRootWindow() { |
- if (GetAshConfig() == Config::MUS) |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) |
return Shell::Get()->window_tree_host_manager()->GetPrimaryRootWindow(); |
// NOTE: This is called before the RootWindowController has been created, so |
// it can't call through to RootWindowController to get all windows. |
@@ -156,7 +155,7 @@ aura::Window* ShellPortMash::GetPrimaryRootWindow() { |
} |
aura::Window* ShellPortMash::GetRootWindowForDisplayId(int64_t display_id) { |
- if (GetAshConfig() == Config::MUS) { |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) { |
return Shell::Get()->window_tree_host_manager()->GetRootWindowForDisplayId( |
display_id); |
} |
@@ -168,8 +167,7 @@ aura::Window* ShellPortMash::GetRootWindowForDisplayId(int64_t display_id) { |
const display::ManagedDisplayInfo& ShellPortMash::GetDisplayInfo( |
int64_t display_id) const { |
- // TODO(sky): mash should use this too http://crbug.com/718860. |
- if (GetAshConfig() == Config::MUS) |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) |
return Shell::Get()->display_manager()->GetDisplayInfo(display_id); |
// TODO(mash): implement http://crbug.com/622480. |
@@ -179,8 +177,7 @@ const display::ManagedDisplayInfo& ShellPortMash::GetDisplayInfo( |
} |
bool ShellPortMash::IsActiveDisplayId(int64_t display_id) const { |
- // TODO(sky): mash should use this too http://crbug.com/718860. |
- if (GetAshConfig() == Config::MUS) |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) |
return Shell::Get()->display_manager()->IsActiveDisplayId(display_id); |
// TODO(mash): implement http://crbug.com/622480. |
@@ -189,8 +186,7 @@ bool ShellPortMash::IsActiveDisplayId(int64_t display_id) const { |
} |
display::Display ShellPortMash::GetFirstDisplay() const { |
- // TODO(sky): mash should use this too http://crbug.com/718860. |
- if (GetAshConfig() == Config::MUS) { |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) { |
return Shell::Get() |
->display_manager() |
->software_mirroring_display_list()[0]; |
@@ -202,8 +198,7 @@ display::Display ShellPortMash::GetFirstDisplay() const { |
} |
bool ShellPortMash::IsInUnifiedMode() const { |
- // TODO(sky): mash should use this too http://crbug.com/718860. |
- if (GetAshConfig() == Config::MUS) |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) |
return Shell::Get()->display_manager()->IsInUnifiedMode(); |
// TODO(mash): implement http://crbug.com/622480. |
@@ -212,8 +207,7 @@ bool ShellPortMash::IsInUnifiedMode() const { |
} |
bool ShellPortMash::IsInUnifiedModeIgnoreMirroring() const { |
- // TODO(sky): mash should use this too http://crbug.com/718860. |
- if (GetAshConfig() == Config::MUS) { |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) { |
return Shell::Get() |
->display_manager() |
->current_default_multi_display_mode() == |
@@ -227,7 +221,7 @@ bool ShellPortMash::IsInUnifiedModeIgnoreMirroring() const { |
void ShellPortMash::SetDisplayWorkAreaInsets(aura::Window* window, |
const gfx::Insets& insets) { |
- if (GetAshConfig() == Config::MUS) { |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) { |
Shell::Get() |
->window_tree_host_manager() |
->UpdateWorkAreaOfDisplayNearestWindow(window, insets); |
@@ -271,7 +265,7 @@ bool ShellPortMash::IsMouseEventsEnabled() { |
} |
std::vector<aura::Window*> ShellPortMash::GetAllRootWindows() { |
- if (GetAshConfig() == Config::MUS) |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) |
return Shell::Get()->window_tree_host_manager()->GetAllRootWindows(); |
aura::Window::Windows root_windows; |
@@ -343,7 +337,7 @@ ShellPortMash::CreateMaximizeModeEventHandler() { |
std::unique_ptr<ScopedDisableInternalMouseAndKeyboard> |
ShellPortMash::CreateScopedDisableInternalMouseAndKeyboard() { |
- if (GetAshConfig() == Config::MUS) { |
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) { |
#if defined(USE_OZONE) |
return base::MakeUnique<ScopedDisableInternalMouseAndKeyboardOzone>(); |
#else |
@@ -389,9 +383,8 @@ std::unique_ptr<KeyEventWatcher> ShellPortMash::CreateKeyEventWatcher() { |
} |
void ShellPortMash::AddDisplayObserver(WmDisplayObserver* observer) { |
- // TODO(sky): mash should use the same code as mus/classic and |
- // WmDisplayObserver should be removed; http://crbug.com/718860. |
- if (GetAshConfig() == Config::MASH) { |
+ // TODO(sky): WmDisplayObserver should be removed; http://crbug.com/718860. |
+ if (!Shell::ShouldEnableSimplifiedDisplayManagement()) { |
NOTIMPLEMENTED(); |
return; |
} |
@@ -403,9 +396,8 @@ void ShellPortMash::AddDisplayObserver(WmDisplayObserver* observer) { |
} |
void ShellPortMash::RemoveDisplayObserver(WmDisplayObserver* observer) { |
- // TODO(sky): mash should use the same code as mus/classic and |
- // WmDisplayObserver should be removed; http://crbug.com/718860. |
- if (GetAshConfig() == Config::MASH) { |
+ // TODO(sky): WmDisplayObserver should be removed; http://crbug.com/718860. |
+ if (!Shell::ShouldEnableSimplifiedDisplayManagement()) { |
NOTIMPLEMENTED(); |
return; |
} |
@@ -520,10 +512,9 @@ void ShellPortMash::OnCreatedRootWindowContainers( |
} |
void ShellPortMash::CreatePrimaryHost() { |
- if (GetAshConfig() == Config::MASH) |
+ if (!Shell::ShouldEnableSimplifiedDisplayManagement()) |
return; |
- DCHECK_EQ(Config::MUS, GetAshConfig()); |
Shell::Get()->window_tree_host_manager()->Start(); |
AshWindowTreeHostInitParams ash_init_params; |
Shell::Get()->window_tree_host_manager()->CreatePrimaryHost(ash_init_params); |