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

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

Issue 1640503002: ash: Do not use MessageLoopForUI when not needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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>
11 #include <X11/extensions/XInput2.h> 11 #include <X11/extensions/XInput2.h>
12 12
13 // Xlib.h defines RootWindow. 13 // Xlib.h defines RootWindow.
14 #undef RootWindow 14 #undef RootWindow
15 #endif 15 #endif
16 16
17 #include "ash/display/cursor_window_controller.h" 17 #include "ash/display/cursor_window_controller.h"
18 #include "ash/display/display_info.h" 18 #include "ash/display/display_info.h"
19 #include "ash/display/display_manager.h" 19 #include "ash/display/display_manager.h"
20 #include "ash/display/root_window_transformers.h" 20 #include "ash/display/root_window_transformers.h"
21 #include "ash/display/screen_position_controller.h" 21 #include "ash/display/screen_position_controller.h"
22 #include "ash/display/window_tree_host_manager.h" 22 #include "ash/display/window_tree_host_manager.h"
23 #include "ash/host/ash_window_tree_host.h" 23 #include "ash/host/ash_window_tree_host.h"
24 #include "ash/host/ash_window_tree_host_init_params.h" 24 #include "ash/host/ash_window_tree_host_init_params.h"
25 #include "ash/host/root_window_transformer.h" 25 #include "ash/host/root_window_transformer.h"
26 #include "ash/root_window_settings.h" 26 #include "ash/root_window_settings.h"
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 "ui/aura/client/capture_client.h" 30 #include "ui/aura/client/capture_client.h"
30 #include "ui/aura/env.h" 31 #include "ui/aura/env.h"
31 #include "ui/aura/window_delegate.h" 32 #include "ui/aura/window_delegate.h"
32 #include "ui/aura/window_event_dispatcher.h" 33 #include "ui/aura/window_event_dispatcher.h"
33 #include "ui/aura/window_tree_host.h" 34 #include "ui/aura/window_tree_host.h"
34 #include "ui/base/layout.h" 35 #include "ui/base/layout.h"
35 #include "ui/compositor/reflector.h" 36 #include "ui/compositor/reflector.h"
36 #include "ui/gfx/canvas.h" 37 #include "ui/gfx/canvas.h"
37 #include "ui/gfx/native_widget_types.h" 38 #include "ui/gfx/native_widget_types.h"
38 39
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 372
372 host->RemoveObserver(Shell::GetInstance()->window_tree_host_manager()); 373 host->RemoveObserver(Shell::GetInstance()->window_tree_host_manager());
373 host->RemoveObserver(this); 374 host->RemoveObserver(this);
374 host_info->ash_host->PrepareForShutdown(); 375 host_info->ash_host->PrepareForShutdown();
375 reflector_->RemoveMirroringLayer(host_info->mirror_window->layer()); 376 reflector_->RemoveMirroringLayer(host_info->mirror_window->layer());
376 377
377 // EventProcessor may be accessed after this call if the mirroring window 378 // EventProcessor may be accessed after this call if the mirroring window
378 // was deleted as a result of input event (e.g. shortcut), so don't delete 379 // was deleted as a result of input event (e.g. shortcut), so don't delete
379 // now. 380 // now.
380 if (delay_host_deletion) 381 if (delay_host_deletion)
381 base::MessageLoop::current()->DeleteSoon(FROM_HERE, host_info); 382 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, host_info);
382 else 383 else
383 delete host_info; 384 delete host_info;
384 } 385 }
385 386
386 } // namespace ash 387 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698