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

Unified Diff: ash/mus/bridge/shell_port_mash.cc

Issue 2904993003: chromeos: changes how DisplayManagerObservers are notified (Closed)
Patch Set: cleanup Created 3 years, 7 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/bridge/shell_port_mash.h ('k') | ash/mus/display_synchronizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 61c964633d1219e855f00b432ed5d6a415dc0e67..2f87d2c671745ead497e7128996093c74f4cef88 100644
--- a/ash/mus/bridge/shell_port_mash.cc
+++ b/ash/mus/bridge/shell_port_mash.cc
@@ -20,6 +20,7 @@
#include "ash/mus/ash_window_tree_host_mus.h"
#include "ash/mus/bridge/immersive_handler_factory_mus.h"
#include "ash/mus/bridge/workspace_event_handler_mus.h"
+#include "ash/mus/display_synchronizer.h"
#include "ash/mus/drag_window_resizer.h"
#include "ash/mus/keyboard_ui_mus.h"
#include "ash/mus/screen_mus.h"
@@ -161,6 +162,8 @@ aura::WindowTreeClient* ShellPortMash::window_tree_client() {
}
void ShellPortMash::Shutdown() {
+ display_synchronizer_.reset();
+
if (added_display_observer_)
Shell::Get()->window_tree_host_manager()->RemoveObserver(this);
@@ -525,8 +528,7 @@ void ShellPortMash::CreatePointerWatcherAdapter() {
std::unique_ptr<AshWindowTreeHost> ShellPortMash::CreateAshWindowTreeHost(
const AshWindowTreeHostInitParams& init_params) {
- // TODO(sky): make this work for mash too.
- if (GetAshConfig() != Config::MUS)
+ if (!Shell::ShouldEnableSimplifiedDisplayManagement())
return nullptr;
std::unique_ptr<aura::DisplayInitParams> display_params =
@@ -544,7 +546,6 @@ std::unique_ptr<AshWindowTreeHost> ShellPortMash::CreateAshWindowTreeHost(
display_params->display =
base::MakeUnique<display::Display>(mirrored_display);
}
- // TODO: wire update is_primary_display correctly.
display_params->is_primary_display = true;
aura::WindowTreeHostMusInitParams aura_init_params =
window_manager_->window_manager_client()->CreateInitParamsForNewDisplay();
@@ -576,8 +577,10 @@ void ShellPortMash::CreatePrimaryHost() {
}
void ShellPortMash::InitHosts(const ShellInitParams& init_params) {
- if (GetAshConfig() == Config::MUS) {
+ if (Shell::ShouldEnableSimplifiedDisplayManagement()) {
Shell::Get()->window_tree_host_manager()->InitHosts();
+ display_synchronizer_ = base::MakeUnique<DisplaySynchronizer>(
+ window_manager_->window_manager_client());
} else {
window_manager_->CreatePrimaryRootWindowController(
base::WrapUnique(init_params.primary_window_tree_host));
« no previous file with comments | « ash/mus/bridge/shell_port_mash.h ('k') | ash/mus/display_synchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698