OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/display/mirror_window_controller.h" | 5 #include "ash/display/mirror_window_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #if defined(USE_X11) | 9 #if defined(USE_X11) |
10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 primary.bounds(), display)); | 167 primary.bounds(), display)); |
168 } else { | 168 } else { |
169 NOTREACHED(); | 169 NOTREACHED(); |
170 } | 170 } |
171 | 171 |
172 if (mirroring_host_info_map_.find(display_info.id()) == | 172 if (mirroring_host_info_map_.find(display_info.id()) == |
173 mirroring_host_info_map_.end()) { | 173 mirroring_host_info_map_.end()) { |
174 AshWindowTreeHostInitParams init_params; | 174 AshWindowTreeHostInitParams init_params; |
175 init_params.initial_bounds = display_info.bounds_in_native(); | 175 init_params.initial_bounds = display_info.bounds_in_native(); |
176 MirroringHostInfo* host_info = new MirroringHostInfo; | 176 MirroringHostInfo* host_info = new MirroringHostInfo; |
177 host_info->ash_host.reset(AshWindowTreeHost::Create(init_params)); | 177 host_info->ash_host = AshWindowTreeHost::Create(init_params); |
178 mirroring_host_info_map_[display_info.id()] = host_info; | 178 mirroring_host_info_map_[display_info.id()] = host_info; |
179 | 179 |
180 aura::WindowTreeHost* host = host_info->ash_host->AsWindowTreeHost(); | 180 aura::WindowTreeHost* host = host_info->ash_host->AsWindowTreeHost(); |
181 host->SetSharedInputMethod( | 181 host->SetSharedInputMethod( |
182 Shell::Get()->window_tree_host_manager()->input_method()); | 182 Shell::Get()->window_tree_host_manager()->input_method()); |
183 host->window()->SetName( | 183 host->window()->SetName( |
184 base::StringPrintf("MirrorRootWindow-%d", mirror_host_count++)); | 184 base::StringPrintf("MirrorRootWindow-%d", mirror_host_count++)); |
185 host->compositor()->SetBackgroundColor(SK_ColorBLACK); | 185 host->compositor()->SetBackgroundColor(SK_ColorBLACK); |
186 // No need to remove the observer because the WindowTreeHostManager | 186 // No need to remove the observer because the WindowTreeHostManager |
187 // outlives the host. | 187 // outlives the host. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // EventProcessor may be accessed after this call if the mirroring window | 367 // EventProcessor may be accessed after this call if the mirroring window |
368 // was deleted as a result of input event (e.g. shortcut), so don't delete | 368 // was deleted as a result of input event (e.g. shortcut), so don't delete |
369 // now. | 369 // now. |
370 if (delay_host_deletion) | 370 if (delay_host_deletion) |
371 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); | 371 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); |
372 else | 372 else |
373 delete host_info; | 373 delete host_info; |
374 } | 374 } |
375 | 375 |
376 } // namespace ash | 376 } // namespace ash |
OLD | NEW |