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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 CloseAndDeleteHost(iter->second, true); | 263 CloseAndDeleteHost(iter->second, true); |
264 iter = mirroring_host_info_map_.erase(iter); | 264 iter = mirroring_host_info_map_.erase(iter); |
265 } else { | 265 } else { |
266 ++iter; | 266 ++iter; |
267 } | 267 } |
268 } | 268 } |
269 } | 269 } |
270 } | 270 } |
271 | 271 |
272 void MirrorWindowController::UpdateWindow() { | 272 void MirrorWindowController::UpdateWindow() { |
273 if (!mirroring_host_info_map_.size()) | 273 if (mirroring_host_info_map_.empty()) |
274 return; | 274 return; |
275 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 275 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); |
276 std::vector<DisplayInfo> display_info_list; | 276 std::vector<DisplayInfo> display_info_list; |
277 for (auto& pair : mirroring_host_info_map_) | 277 for (auto& pair : mirroring_host_info_map_) |
278 display_info_list.push_back(display_manager->GetDisplayInfo(pair.first)); | 278 display_info_list.push_back(display_manager->GetDisplayInfo(pair.first)); |
279 UpdateWindow(display_info_list); | 279 UpdateWindow(display_info_list); |
280 } | 280 } |
281 | 281 |
282 void MirrorWindowController::CloseIfNotNecessary() { | 282 void MirrorWindowController::CloseIfNotNecessary() { |
283 DisplayManager::MultiDisplayMode new_mode = GetCurrentMultiDisplayMode(); | 283 DisplayManager::MultiDisplayMode new_mode = GetCurrentMultiDisplayMode(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // EventProcessor may be accessed after this call if the mirroring window | 380 // 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 | 381 // was deleted as a result of input event (e.g. shortcut), so don't delete |
382 // now. | 382 // now. |
383 if (delay_host_deletion) | 383 if (delay_host_deletion) |
384 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); | 384 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info); |
385 else | 385 else |
386 delete host_info; | 386 delete host_info; |
387 } | 387 } |
388 | 388 |
389 } // namespace ash | 389 } // namespace ash |
OLD | NEW |