Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: ash/display/mirror_window_controller.cc

Issue 1838833002: Move DisplayLayout and DisplayLayoutBuilder From ash To ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screenwinmove
Patch Set: Fix comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « ash/display/json_converter_unittest.cc ('k') | ash/display/mouse_cursor_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698