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

Unified Diff: ui/events/event.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 6548405f179299cc34a2276d462b044423915eee..dd16d5860df0c4b5048a0e66f23f23c01bbb855f 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -6,6 +6,8 @@
#include <utility>
+#include "base/memory/ptr_util.h"
+
#if defined(USE_X11)
#include <X11/extensions/XInput2.h>
#include <X11/keysym.h>
@@ -163,42 +165,42 @@ namespace ui {
// Event
// static
-scoped_ptr<Event> Event::Clone(const Event& event) {
+std::unique_ptr<Event> Event::Clone(const Event& event) {
if (event.IsKeyEvent()) {
- return make_scoped_ptr(new KeyEvent(static_cast<const KeyEvent&>(event)));
+ return base::WrapUnique(new KeyEvent(static_cast<const KeyEvent&>(event)));
}
if (event.IsMouseEvent()) {
if (event.IsMouseWheelEvent()) {
- return make_scoped_ptr(
+ return base::WrapUnique(
new MouseWheelEvent(static_cast<const MouseWheelEvent&>(event)));
}
- return make_scoped_ptr(
+ return base::WrapUnique(
new MouseEvent(static_cast<const MouseEvent&>(event)));
}
if (event.IsTouchEvent()) {
- return make_scoped_ptr(
+ return base::WrapUnique(
new TouchEvent(static_cast<const TouchEvent&>(event)));
}
if (event.IsGestureEvent()) {
- return make_scoped_ptr(
+ return base::WrapUnique(
new GestureEvent(static_cast<const GestureEvent&>(event)));
}
if (event.IsPointerEvent()) {
- return make_scoped_ptr(
+ return base::WrapUnique(
new PointerEvent(static_cast<const PointerEvent&>(event)));
}
if (event.IsScrollEvent()) {
- return make_scoped_ptr(
+ return base::WrapUnique(
new ScrollEvent(static_cast<const ScrollEvent&>(event)));
}
- return make_scoped_ptr(new Event(event));
+ return base::WrapUnique(new Event(event));
}
Event::~Event() {
@@ -986,7 +988,8 @@ KeyEvent& KeyEvent::operator=(const KeyEvent& rhs) {
KeyEvent::~KeyEvent() {}
-void KeyEvent::SetExtendedKeyEventData(scoped_ptr<ExtendedKeyEventData> data) {
+void KeyEvent::SetExtendedKeyEventData(
+ std::unique_ptr<ExtendedKeyEventData> data) {
extended_key_event_data_ = std::move(data);
}
« no previous file with comments | « ui/events/event.h ('k') | ui/events/event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698