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

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

Issue 2257763002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « ash/sysui/sysui_application.cc ('k') | ash/wm/lock_state_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698