| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 ->second->ash_host->AsWindowTreeHost() | 326 ->second->ash_host->AsWindowTreeHost() |
| 327 ->window(); | 327 ->window(); |
| 328 } | 328 } |
| 329 | 329 |
| 330 display::Display MirrorWindowController::GetDisplayForRootWindow( | 330 display::Display MirrorWindowController::GetDisplayForRootWindow( |
| 331 const aura::Window* root) const { | 331 const aura::Window* root) const { |
| 332 for (const auto& pair : mirroring_host_info_map_) { | 332 for (const auto& pair : mirroring_host_info_map_) { |
| 333 if (pair.second->ash_host->AsWindowTreeHost()->window() == root) { | 333 if (pair.second->ash_host->AsWindowTreeHost()->window() == root) { |
| 334 // Sanity check to catch an error early. | 334 // Sanity check to catch an error early. |
| 335 int64_t id = pair.first; | 335 int64_t id = pair.first; |
| 336 const display::DisplayList& list = | 336 const display::Displays& list = Shell::GetInstance() |
| 337 Shell::GetInstance() | 337 ->display_manager() |
| 338 ->display_manager() | 338 ->software_mirroring_display_list(); |
| 339 ->software_mirroring_display_list(); | |
| 340 auto iter = std::find_if( | 339 auto iter = std::find_if( |
| 341 list.begin(), list.end(), | 340 list.begin(), list.end(), |
| 342 [id](const display::Display& display) { return display.id() == id; }); | 341 [id](const display::Display& display) { return display.id() == id; }); |
| 343 DCHECK(iter != list.end()); | 342 DCHECK(iter != list.end()); |
| 344 if (iter != list.end()) | 343 if (iter != list.end()) |
| 345 return *iter; | 344 return *iter; |
| 346 } | 345 } |
| 347 } | 346 } |
| 348 return display::Display(); | 347 return display::Display(); |
| 349 } | 348 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 380 // EventProcessor may be accessed after this call if the mirroring window | 379 // EventProcessor may be accessed after this call if the mirroring window |
| 381 // was deleted as a result of input event (e.g. shortcut), so don't delete | 380 // was deleted as a result of input event (e.g. shortcut), so don't delete |
| 382 // now. | 381 // now. |
| 383 if (delay_host_deletion) | 382 if (delay_host_deletion) |
| 384 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); | 383 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); |
| 385 else | 384 else |
| 386 delete host_info; | 385 delete host_info; |
| 387 } | 386 } |
| 388 | 387 |
| 389 } // namespace ash | 388 } // namespace ash |
| OLD | NEW |