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

Side by Side Diff: ash/wm/drag_window_controller.cc

Issue 2779653003: WindowTreeHostManager::GetRootWindowForDisplayId -> WmShell::GetRoo... (Closed)
Patch Set: Created 3 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wm/drag_window_controller.h" 5 #include "ash/wm/drag_window_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/display/window_tree_host_manager.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/common/wm_window.h"
10 #include "ash/public/cpp/shell_window_ids.h" 11 #include "ash/public/cpp/shell_window_ids.h"
11 #include "ash/shell.h" 12 #include "ash/shell.h"
12 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
13 #include "base/memory/ptr_util.h" 14 #include "base/memory/ptr_util.h"
14 #include "ui/aura/client/aura_constants.h" 15 #include "ui/aura/client/aura_constants.h"
15 #include "ui/aura/client/screen_position_client.h" 16 #include "ui/aura/client/screen_position_client.h"
16 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
17 #include "ui/aura/window_delegate.h" 18 #include "ui/aura/window_delegate.h"
18 #include "ui/aura/window_event_dispatcher.h" 19 #include "ui/aura/window_event_dispatcher.h"
19 #include "ui/base/hit_test.h" 20 #include "ui/base/hit_test.h"
20 #include "ui/compositor/layer.h" 21 #include "ui/compositor/layer.h"
21 #include "ui/compositor/layer_tree_owner.h" 22 #include "ui/compositor/layer_tree_owner.h"
22 #include "ui/compositor/paint_context.h" 23 #include "ui/compositor/paint_context.h"
23 #include "ui/compositor/scoped_layer_animation_settings.h" 24 #include "ui/compositor/scoped_layer_animation_settings.h"
25 #include "ui/display/display.h"
24 #include "ui/views/view.h" 26 #include "ui/views/view.h"
25 #include "ui/views/widget/widget.h" 27 #include "ui/views/widget/widget.h"
26 #include "ui/wm/core/coordinate_conversion.h" 28 #include "ui/wm/core/coordinate_conversion.h"
27 #include "ui/wm/core/shadow_types.h" 29 #include "ui/wm/core/shadow_types.h"
28 #include "ui/wm/core/window_util.h" 30 #include "ui/wm/core/window_util.h"
29 31
30 namespace ash { 32 namespace ash {
31 33
32 // This keeps track of the drag window's state. It creates/destroys/updates 34 // This keeps track of the drag window's state. It creates/destroys/updates
33 // bounds and opacity based on the current bounds. 35 // bounds and opacity based on the current bounds.
34 class DragWindowController::DragWindowDetails : public aura::WindowDelegate { 36 class DragWindowController::DragWindowDetails : public aura::WindowDelegate {
35 public: 37 public:
36 DragWindowDetails(const display::Display& display, 38 DragWindowDetails(const display::Display& display,
37 aura::Window* original_window) 39 aura::Window* original_window)
38 : root_window_(Shell::GetInstance() 40 : root_window_(WmShell::Get()
39 ->window_tree_host_manager() 41 ->GetRootWindowForDisplayId(display.id())
40 ->GetRootWindowForDisplayId(display.id())) {} 42 ->aura_window()) {}
41 43
42 ~DragWindowDetails() override { 44 ~DragWindowDetails() override {
43 delete drag_window_; 45 delete drag_window_;
44 DCHECK(!drag_window_); 46 DCHECK(!drag_window_);
45 } 47 }
46 48
47 void Update(aura::Window* original_window, 49 void Update(aura::Window* original_window,
48 const gfx::Rect& bounds_in_screen, 50 const gfx::Rect& bounds_in_screen,
49 const gfx::Point& drag_location_in_screen) { 51 const gfx::Point& drag_location_in_screen) {
50 gfx::Rect root_bounds_in_screen = root_window_->GetBoundsInScreen(); 52 gfx::Rect root_bounds_in_screen = root_window_->GetBoundsInScreen();
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 layers.pop_back(); 245 layers.pop_back();
244 if (layer->delegate()) 246 if (layer->delegate())
245 layer->delegate()->OnPaintLayer(context); 247 layer->delegate()->OnPaintLayer(context);
246 for (auto* child : layer->children()) 248 for (auto* child : layer->children())
247 layers.push_back(child); 249 layers.push_back(child);
248 } 250 }
249 } 251 }
250 } 252 }
251 253
252 } // namespace ash 254 } // namespace ash
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay_unittest.cc ('k') | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698