OLD | NEW |
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/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/shell_port.h" |
11 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
12 #include "ash/wm_shell.h" | |
13 #include "ash/wm_window.h" | 13 #include "ash/wm_window.h" |
14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
15 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
16 #include "ui/aura/client/screen_position_client.h" | 16 #include "ui/aura/client/screen_position_client.h" |
17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
18 #include "ui/aura/window_delegate.h" | 18 #include "ui/aura/window_delegate.h" |
19 #include "ui/aura/window_event_dispatcher.h" | 19 #include "ui/aura/window_event_dispatcher.h" |
20 #include "ui/base/hit_test.h" | 20 #include "ui/base/hit_test.h" |
21 #include "ui/compositor/layer.h" | 21 #include "ui/compositor/layer.h" |
22 #include "ui/compositor/layer_tree_owner.h" | 22 #include "ui/compositor/layer_tree_owner.h" |
23 #include "ui/compositor/paint_context.h" | 23 #include "ui/compositor/paint_context.h" |
24 #include "ui/compositor/scoped_layer_animation_settings.h" | 24 #include "ui/compositor/scoped_layer_animation_settings.h" |
25 #include "ui/display/display.h" | 25 #include "ui/display/display.h" |
26 #include "ui/views/view.h" | 26 #include "ui/views/view.h" |
27 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
28 #include "ui/wm/core/coordinate_conversion.h" | 28 #include "ui/wm/core/coordinate_conversion.h" |
29 #include "ui/wm/core/shadow_types.h" | 29 #include "ui/wm/core/shadow_types.h" |
30 #include "ui/wm/core/window_util.h" | 30 #include "ui/wm/core/window_util.h" |
31 | 31 |
32 namespace ash { | 32 namespace ash { |
33 | 33 |
34 // 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 |
35 // bounds and opacity based on the current bounds. | 35 // bounds and opacity based on the current bounds. |
36 class DragWindowController::DragWindowDetails : public aura::WindowDelegate { | 36 class DragWindowController::DragWindowDetails : public aura::WindowDelegate { |
37 public: | 37 public: |
38 DragWindowDetails(const display::Display& display, | 38 DragWindowDetails(const display::Display& display, |
39 aura::Window* original_window) | 39 aura::Window* original_window) |
40 : root_window_(WmShell::Get() | 40 : root_window_(ShellPort::Get() |
41 ->GetRootWindowForDisplayId(display.id()) | 41 ->GetRootWindowForDisplayId(display.id()) |
42 ->aura_window()) {} | 42 ->aura_window()) {} |
43 | 43 |
44 ~DragWindowDetails() override { | 44 ~DragWindowDetails() override { |
45 delete drag_window_; | 45 delete drag_window_; |
46 DCHECK(!drag_window_); | 46 DCHECK(!drag_window_); |
47 } | 47 } |
48 | 48 |
49 void Update(aura::Window* original_window, | 49 void Update(aura::Window* original_window, |
50 const gfx::Rect& bounds_in_screen, | 50 const gfx::Rect& bounds_in_screen, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 layers.pop_back(); | 245 layers.pop_back(); |
246 if (layer->delegate()) | 246 if (layer->delegate()) |
247 layer->delegate()->OnPaintLayer(context); | 247 layer->delegate()->OnPaintLayer(context); |
248 for (auto* child : layer->children()) | 248 for (auto* child : layer->children()) |
249 layers.push_back(child); | 249 layers.push_back(child); |
250 } | 250 } |
251 } | 251 } |
252 } | 252 } |
253 | 253 |
254 } // namespace ash | 254 } // namespace ash |
OLD | NEW |