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/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 DragWindowController::DragWindowController(aura::Window* window) | 199 DragWindowController::DragWindowController(aura::Window* window) |
200 : window_(window) { | 200 : window_(window) { |
201 DCHECK(drag_windows_.empty()); | 201 DCHECK(drag_windows_.empty()); |
202 display::Screen* screen = display::Screen::GetScreen(); | 202 display::Screen* screen = display::Screen::GetScreen(); |
203 display::Display current = screen->GetDisplayNearestWindow(window_); | 203 display::Display current = screen->GetDisplayNearestWindow(window_); |
204 | 204 |
205 for (const display::Display& display : screen->GetAllDisplays()) { | 205 for (const display::Display& display : screen->GetAllDisplays()) { |
206 if (current.id() == display.id()) | 206 if (current.id() == display.id()) |
207 continue; | 207 continue; |
208 drag_windows_.push_back( | 208 drag_windows_.push_back( |
209 base::WrapUnique(new DragWindowDetails(display, window_))); | 209 base::MakeUnique<DragWindowDetails>(display, window_)); |
210 } | 210 } |
211 } | 211 } |
212 | 212 |
213 DragWindowController::~DragWindowController() {} | 213 DragWindowController::~DragWindowController() {} |
214 | 214 |
215 void DragWindowController::Update(const gfx::Rect& bounds_in_screen, | 215 void DragWindowController::Update(const gfx::Rect& bounds_in_screen, |
216 const gfx::Point& drag_location_in_screen) { | 216 const gfx::Point& drag_location_in_screen) { |
217 for (std::unique_ptr<DragWindowDetails>& details : drag_windows_) | 217 for (std::unique_ptr<DragWindowDetails>& details : drag_windows_) |
218 details->Update(window_, bounds_in_screen, drag_location_in_screen); | 218 details->Update(window_, bounds_in_screen, drag_location_in_screen); |
219 } | 219 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 layers.pop_back(); | 261 layers.pop_back(); |
262 if (layer->delegate()) | 262 if (layer->delegate()) |
263 layer->delegate()->OnPaintLayer(context); | 263 layer->delegate()->OnPaintLayer(context); |
264 for (auto* child : layer->children()) | 264 for (auto* child : layer->children()) |
265 layers.push_back(child); | 265 layers.push_back(child); |
266 } | 266 } |
267 } | 267 } |
268 } | 268 } |
269 | 269 |
270 } // namespace ash | 270 } // namespace ash |
OLD | NEW |