| Index: ash/shell.cc
|
| diff --git a/ash/shell.cc b/ash/shell.cc
|
| index 8cdfec9c861977a5c88ca323d51d7546de3f1125..c45bc4aa3f6c818ae15dd6a6683b2472d2438cb0 100644
|
| --- a/ash/shell.cc
|
| +++ b/ash/shell.cc
|
| @@ -154,7 +154,6 @@
|
| #include "ui/display/manager/chromeos/display_configurator.h"
|
| #include "ui/display/manager/display_manager.h"
|
| #include "ui/display/screen.h"
|
| -#include "ui/display/types/native_display_delegate.h"
|
| #include "ui/events/event_target_iterator.h"
|
| #include "ui/gfx/geometry/insets.h"
|
| #include "ui/gfx/image/image_skia.h"
|
| @@ -172,6 +171,16 @@
|
| #include "ui/wm/core/shadow_controller.h"
|
| #include "ui/wm/core/visibility_controller.h"
|
| #include "ui/wm/core/window_modality_controller.h"
|
| +
|
| +#if defined(USE_X11)
|
| +#include "ui/display/manager/chromeos/x11/native_display_delegate_x11.h"
|
| +#include "ui/gfx/x/x11_types.h" // nogncheck
|
| +#endif
|
| +
|
| +#if defined(USE_OZONE)
|
| +#include "ui/display/types/native_display_delegate.h"
|
| +#include "ui/ozone/public/ozone_platform.h"
|
| +#endif
|
|
|
| namespace ash {
|
|
|
| @@ -570,10 +579,9 @@
|
| // TODO(sky): better refactor cash/mash dependencies. Perhaps put all cash
|
| // state on ShellPortClassic. http://crbug.com/671246.
|
|
|
| - gpu_support_.reset(shell_delegate_->CreateGPUSupport());
|
| -
|
| // Don't use Shell::GetAshConfig() as |instance_| has not yet been set.
|
| if (shell_port_->GetAshConfig() != Config::MASH) {
|
| + gpu_support_.reset(shell_delegate_->CreateGPUSupport());
|
| display_manager_.reset(ScreenAsh::CreateDisplayManager());
|
| window_tree_host_manager_.reset(new WindowTreeHostManager);
|
| user_metrics_recorder_.reset(new UserMetricsRecorder);
|
| @@ -838,20 +846,24 @@
|
| }
|
|
|
| shell_delegate_->PreInit();
|
| - // TODO(sky): remove MASH from here.
|
| - bool display_initialized =
|
| - (config == Config::MASH || display_manager_->InitFromCommandLine());
|
| - if (config == Config::MUS && !display_initialized) {
|
| - // Run display configuration off device in mus mode.
|
| - display_manager_->set_configure_displays(true);
|
| - display_configurator_->set_configure_display(true);
|
| - }
|
| - if (config != Config::MASH) {
|
| - // TODO(sky): should work in mash too.
|
| + bool display_initialized = true;
|
| + if (config == Config::CLASSIC) {
|
| + // TODO: decide if this needs to be made to work in Config::MUS.
|
| + // http://crbug.com/705595.
|
| + display_initialized = display_manager_->InitFromCommandLine();
|
| +
|
| display_configuration_controller_.reset(new DisplayConfigurationController(
|
| display_manager_.get(), window_tree_host_manager_.get()));
|
| - display_configurator_->Init(shell_port_->CreateNativeDisplayDelegate(),
|
| - !gpu_support_->IsPanelFittingDisabled());
|
| +
|
| +#if defined(USE_OZONE)
|
| + display_configurator_->Init(
|
| + ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(),
|
| + !gpu_support_->IsPanelFittingDisabled());
|
| +#elif defined(USE_X11)
|
| + display_configurator_->Init(
|
| + base::MakeUnique<display::NativeDisplayDelegateX11>(),
|
| + !gpu_support_->IsPanelFittingDisabled());
|
| +#endif
|
| }
|
|
|
| // The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell.
|
| @@ -862,10 +874,7 @@
|
| display_configurator_->AddObserver(projecting_observer_.get());
|
| AddShellObserver(projecting_observer_.get());
|
|
|
| - // TODO(sky): once simplified display management is enabled for mash
|
| - // config == Config::MUS should be config != Config::CLASSIC.
|
| - if (!display_initialized &&
|
| - (config == Config::MUS || chromeos::IsRunningAsSystemCompositor())) {
|
| + if (!display_initialized && chromeos::IsRunningAsSystemCompositor()) {
|
| display_change_observer_ = base::MakeUnique<display::DisplayChangeObserver>(
|
| display_configurator_.get(), display_manager_.get());
|
|
|
| @@ -1048,8 +1057,7 @@
|
| // WindowTreeHostManager::InitDisplays()
|
| // since AshTouchTransformController listens on
|
| // WindowTreeHostManager::Observer::OnDisplaysInitialized().
|
| - // TODO(sky): needs to to work for mus too.
|
| - if (config == Config::CLASSIC) {
|
| + if (config != Config::MASH) {
|
| touch_transformer_controller_.reset(new AshTouchTransformController(
|
| display_configurator_.get(), display_manager_.get()));
|
| }
|
|
|