| 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/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ash/shell.h" | 27 #include "ash/shell.h" |
| 28 #include "base/strings/stringprintf.h" | 28 #include "base/strings/stringprintf.h" |
| 29 #include "base/thread_task_runner_handle.h" | 29 #include "base/thread_task_runner_handle.h" |
| 30 #include "ui/aura/client/capture_client.h" | 30 #include "ui/aura/client/capture_client.h" |
| 31 #include "ui/aura/env.h" | 31 #include "ui/aura/env.h" |
| 32 #include "ui/aura/window_delegate.h" | 32 #include "ui/aura/window_delegate.h" |
| 33 #include "ui/aura/window_event_dispatcher.h" | 33 #include "ui/aura/window_event_dispatcher.h" |
| 34 #include "ui/aura/window_tree_host.h" | 34 #include "ui/aura/window_tree_host.h" |
| 35 #include "ui/base/layout.h" | 35 #include "ui/base/layout.h" |
| 36 #include "ui/compositor/reflector.h" | 36 #include "ui/compositor/reflector.h" |
| 37 #include "ui/display/manager/display_layout.h" |
| 37 #include "ui/gfx/canvas.h" | 38 #include "ui/gfx/canvas.h" |
| 38 #include "ui/gfx/native_widget_types.h" | 39 #include "ui/gfx/native_widget_types.h" |
| 39 #include "ui/gfx/screen.h" | 40 #include "ui/gfx/screen.h" |
| 40 | 41 |
| 41 #if defined(USE_X11) | 42 #if defined(USE_X11) |
| 42 #include "ui/gfx/x/x11_types.h" // nogncheck | 43 #include "ui/gfx/x/x11_types.h" // nogncheck |
| 43 #endif | 44 #endif |
| 44 | 45 |
| 45 namespace ash { | 46 namespace ash { |
| 46 namespace { | 47 namespace { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 ->second->ash_host->AsWindowTreeHost() | 326 ->second->ash_host->AsWindowTreeHost() |
| 326 ->window(); | 327 ->window(); |
| 327 } | 328 } |
| 328 | 329 |
| 329 gfx::Display MirrorWindowController::GetDisplayForRootWindow( | 330 gfx::Display MirrorWindowController::GetDisplayForRootWindow( |
| 330 const aura::Window* root) const { | 331 const aura::Window* root) const { |
| 331 for (const auto& pair : mirroring_host_info_map_) { | 332 for (const auto& pair : mirroring_host_info_map_) { |
| 332 if (pair.second->ash_host->AsWindowTreeHost()->window() == root) { | 333 if (pair.second->ash_host->AsWindowTreeHost()->window() == root) { |
| 333 // Sanity check to catch an error early. | 334 // Sanity check to catch an error early. |
| 334 int64_t id = pair.first; | 335 int64_t id = pair.first; |
| 335 const DisplayList& list = Shell::GetInstance() | 336 const display::DisplayList& list = |
| 336 ->display_manager() | 337 Shell::GetInstance() |
| 337 ->software_mirroring_display_list(); | 338 ->display_manager() |
| 339 ->software_mirroring_display_list(); |
| 338 auto iter = std::find_if( | 340 auto iter = std::find_if( |
| 339 list.begin(), list.end(), | 341 list.begin(), list.end(), |
| 340 [id](const gfx::Display& display) { return display.id() == id; }); | 342 [id](const gfx::Display& display) { return display.id() == id; }); |
| 341 DCHECK(iter != list.end()); | 343 DCHECK(iter != list.end()); |
| 342 if (iter != list.end()) | 344 if (iter != list.end()) |
| 343 return *iter; | 345 return *iter; |
| 344 } | 346 } |
| 345 } | 347 } |
| 346 return gfx::Display(); | 348 return gfx::Display(); |
| 347 } | 349 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 378 // EventProcessor may be accessed after this call if the mirroring window | 380 // EventProcessor may be accessed after this call if the mirroring window |
| 379 // was deleted as a result of input event (e.g. shortcut), so don't delete | 381 // was deleted as a result of input event (e.g. shortcut), so don't delete |
| 380 // now. | 382 // now. |
| 381 if (delay_host_deletion) | 383 if (delay_host_deletion) |
| 382 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); | 384 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); |
| 383 else | 385 else |
| 384 delete host_info; | 386 delete host_info; |
| 385 } | 387 } |
| 386 | 388 |
| 387 } // namespace ash | 389 } // namespace ash |
| OLD | NEW |