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

Unified Diff: ash/display/extended_mouse_warp_controller.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ash/display/extended_mouse_warp_controller.cc
diff --git a/ash/display/extended_mouse_warp_controller.cc b/ash/display/extended_mouse_warp_controller.cc
index 78e8095177a3ab68f539b793701ac66750d43662..b532595f58797b1df2e6dc3b2f914a58e55c2fff 100644
--- a/ash/display/extended_mouse_warp_controller.cc
+++ b/ash/display/extended_mouse_warp_controller.cc
@@ -13,6 +13,7 @@
#include "ash/root_window_controller.h"
#include "ash/screen_util.h"
#include "ash/shell.h"
+#include "base/memory/ptr_util.h"
#include "ui/aura/window.h"
#include "ui/display/manager/display_layout.h"
#include "ui/events/event_utils.h"
@@ -113,7 +114,7 @@ ExtendedMouseWarpController::ExtendedMouseWarpController(
gfx::Display display = display_list.back();
display_list.pop_back();
for (const gfx::Display& peer : display_list) {
- scoped_ptr<WarpRegion> region =
+ std::unique_ptr<WarpRegion> region =
CreateWarpRegion(display, peer, drag_source_id);
if (region)
AddWarpRegion(std::move(region), drag_source != nullptr);
@@ -165,7 +166,7 @@ void ExtendedMouseWarpController::SetEnabled(bool enabled) {
}
void ExtendedMouseWarpController::AddWarpRegion(
- scoped_ptr<WarpRegion> warp_region,
+ std::unique_ptr<WarpRegion> warp_region,
bool has_drag_source) {
if (has_drag_source) {
warp_region->shared_display_edge_indicator_.reset(
@@ -181,7 +182,7 @@ bool ExtendedMouseWarpController::WarpMouseCursorInNativeCoords(
const gfx::Point& point_in_native,
const gfx::Point& point_in_screen,
bool update_mouse_location_now) {
- for (const scoped_ptr<WarpRegion>& warp : warp_regions_) {
+ for (const std::unique_ptr<WarpRegion>& warp : warp_regions_) {
bool in_a_edge = warp->a_edge_bounds_in_native_.Contains(point_in_native);
bool in_b_edge = warp->b_edge_bounds_in_native_.Contains(point_in_native);
if (!in_a_edge && !in_b_edge)
@@ -200,7 +201,7 @@ bool ExtendedMouseWarpController::WarpMouseCursorInNativeCoords(
return false;
}
-scoped_ptr<ExtendedMouseWarpController::WarpRegion>
+std::unique_ptr<ExtendedMouseWarpController::WarpRegion>
ExtendedMouseWarpController::CreateWarpRegion(const gfx::Display& a,
const gfx::Display& b,
int64_t drag_source_id) {
@@ -221,7 +222,7 @@ ExtendedMouseWarpController::CreateWarpRegion(const gfx::Display& a,
AdjustSourceEdgeBounds(b.bounds(), snap_barrier, &b_edge);
}
- return make_scoped_ptr(new WarpRegion(a.id(), b.id(), a_edge, b_edge));
+ return base::WrapUnique(new WarpRegion(a.id(), b.id(), a_edge, b_edge));
}
} // namespace ash
« no previous file with comments | « ash/display/extended_mouse_warp_controller.h ('k') | ash/display/extended_mouse_warp_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698