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

Unified Diff: ash/shell.cc

Issue 2840043003: chromeos: Makes mushrome use simplified display management (Closed)
Patch Set: merge Created 3 years, 8 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/mus/window_manager_application.cc ('k') | ash/shell_init_params.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 c45bc4aa3f6c818ae15dd6a6683b2472d2438cb0..8cdfec9c861977a5c88ca323d51d7546de3f1125 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -154,6 +154,7 @@
#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,16 +173,6 @@
#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 {
namespace {
@@ -579,9 +570,10 @@ Shell::Shell(std::unique_ptr<ShellDelegate> shell_delegate,
// 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);
@@ -846,24 +838,20 @@ void Shell::Init(const ShellInitParams& init_params) {
}
shell_delegate_->PreInit();
- 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();
-
+ // 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.
display_configuration_controller_.reset(new DisplayConfigurationController(
display_manager_.get(), window_tree_host_manager_.get()));
-
-#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
+ display_configurator_->Init(shell_port_->CreateNativeDisplayDelegate(),
+ !gpu_support_->IsPanelFittingDisabled());
}
// The DBusThreadManager must outlive this Shell. See the DCHECK in ~Shell.
@@ -874,7 +862,10 @@ void Shell::Init(const ShellInitParams& init_params) {
display_configurator_->AddObserver(projecting_observer_.get());
AddShellObserver(projecting_observer_.get());
- if (!display_initialized && chromeos::IsRunningAsSystemCompositor()) {
+ // 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())) {
display_change_observer_ = base::MakeUnique<display::DisplayChangeObserver>(
display_configurator_.get(), display_manager_.get());
@@ -1057,7 +1048,8 @@ void Shell::Init(const ShellInitParams& init_params) {
// WindowTreeHostManager::InitDisplays()
// since AshTouchTransformController listens on
// WindowTreeHostManager::Observer::OnDisplaysInitialized().
- if (config != Config::MASH) {
+ // TODO(sky): needs to to work for mus too.
+ if (config == Config::CLASSIC) {
touch_transformer_controller_.reset(new AshTouchTransformController(
display_configurator_.get(), display_manager_.get()));
}
« no previous file with comments | « ash/mus/window_manager_application.cc ('k') | ash/shell_init_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698