Index: ash/display/mirror_window_controller.cc |
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc |
index 55670a9f516e227f2ea19d207bdb43631c41dbc6..8560b6fa410bdfb3f56fadc2ae16470e25ef1db0 100644 |
--- a/ash/display/mirror_window_controller.cc |
+++ b/ash/display/mirror_window_controller.cc |
@@ -173,13 +173,19 @@ void MirrorWindowController::UpdateWindow( |
mirroring_host_info_map_.end()) { |
AshWindowTreeHostInitParams init_params; |
init_params.initial_bounds = display_info.bounds_in_native(); |
+ init_params.display_id = display_info.id(); |
+ init_params.device_scale_factor = display_info.device_scale_factor(); |
+ init_params.ui_scale_factor = display_info.configured_ui_scale(); |
MirroringHostInfo* host_info = new MirroringHostInfo; |
host_info->ash_host = AshWindowTreeHost::Create(init_params); |
mirroring_host_info_map_[display_info.id()] = host_info; |
aura::WindowTreeHost* host = host_info->ash_host->AsWindowTreeHost(); |
- host->SetSharedInputMethod( |
- Shell::Get()->window_tree_host_manager()->input_method()); |
+ // XXX figure this out! |
+ if (!host->has_input_method()) { |
+ host->SetSharedInputMethod( |
+ Shell::Get()->window_tree_host_manager()->input_method()); |
+ } |
host->window()->SetName( |
base::StringPrintf("MirrorRootWindow-%d", mirror_host_count++)); |
host->compositor()->SetBackgroundColor(SK_ColorBLACK); |
@@ -222,13 +228,15 @@ void MirrorWindowController::UpdateWindow( |
mirror_window->Show(); |
if (reflector_) { |
reflector_->AddMirroringLayer(mirror_window->layer()); |
- } else { |
+ } else if (aura::Env::GetInstance()->context_factory_private()) { |
reflector_ = |
aura::Env::GetInstance() |
->context_factory_private() |
->CreateReflector( |
Shell::GetPrimaryRootWindow()->GetHost()->compositor(), |
mirror_window->layer()); |
+ } else { |
+ NOTIMPLEMENTED(); |
} |
} else { |
AshWindowTreeHost* ash_host = |
@@ -294,7 +302,8 @@ void MirrorWindowController::OnHostResized(const aura::WindowTreeHost* host) { |
if (info->mirror_window_host_size == host->GetBoundsInPixels().size()) |
return; |
info->mirror_window_host_size = host->GetBoundsInPixels().size(); |
- reflector_->OnMirroringCompositorResized(); |
+ if (reflector_) |
+ reflector_->OnMirroringCompositorResized(); |
// No need to update the transformer as new transformer is already set |
// in UpdateWindow. |
Shell::Get() |
@@ -362,7 +371,8 @@ void MirrorWindowController::CloseAndDeleteHost(MirroringHostInfo* host_info, |
host->RemoveObserver(Shell::Get()->window_tree_host_manager()); |
host->RemoveObserver(this); |
host_info->ash_host->PrepareForShutdown(); |
- reflector_->RemoveMirroringLayer(host_info->mirror_window->layer()); |
+ if (reflector_) |
+ reflector_->RemoveMirroringLayer(host_info->mirror_window->layer()); |
// EventProcessor may be accessed after this call if the mirroring window |
// was deleted as a result of input event (e.g. shortcut), so don't delete |