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

Unified Diff: ui/aura/window_event_dispatcher.cc

Issue 2628393003: Remove ScopedVector from ui/events/. (Closed)
Patch Set: chromeos2 Created 3 years, 11 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: ui/aura/window_event_dispatcher.cc
diff --git a/ui/aura/window_event_dispatcher.cc b/ui/aura/window_event_dispatcher.cc
index 02495f46a91208498c875210eb8e2f5933c43573..4ccccb4cb7cd7e4d147c17046c18a30a03a4d4ac 100644
--- a/ui/aura/window_event_dispatcher.cc
+++ b/ui/aura/window_event_dispatcher.cc
@@ -158,10 +158,10 @@ DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint(
void WindowEventDispatcher::ProcessedTouchEvent(uint32_t unique_event_id,
Window* window,
ui::EventResult result) {
- std::unique_ptr<ui::GestureRecognizer::Gestures> gestures(
+ ui::GestureRecognizer::Gestures gestures =
ui::GestureRecognizer::Get()->AckTouchEvent(unique_event_id, result,
- window));
- DispatchDetails details = ProcessGestures(window, gestures.get());
+ window);
+ DispatchDetails details = ProcessGestures(window, std::move(gestures));
if (details.dispatcher_destroyed)
return;
}
@@ -275,9 +275,9 @@ ui::EventDispatchDetails WindowEventDispatcher::DispatchMouseEnterOrExit(
ui::EventDispatchDetails WindowEventDispatcher::ProcessGestures(
Window* target,
- ui::GestureRecognizer::Gestures* gestures) {
+ ui::GestureRecognizer::Gestures gestures) {
DispatchDetails details;
- if (!gestures || gestures->empty())
+ if (gestures.empty())
return details;
// If a window has been hidden between the touch event and now, the associated
@@ -285,10 +285,9 @@ ui::EventDispatchDetails WindowEventDispatcher::ProcessGestures(
if (!target)
return details;
- for (size_t i = 0; i < gestures->size(); ++i) {
- ui::GestureEvent* event = gestures->get().at(i);
+ for (const auto& event : gestures) {
event->ConvertLocationToTarget(window(), target);
- details = DispatchEvent(target, event);
+ details = DispatchEvent(target, event.get());
if (details.dispatcher_destroyed || details.target_destroyed)
break;
}
@@ -486,13 +485,12 @@ ui::EventDispatchDetails WindowEventDispatcher::PostDispatchEvent(
const ui::TouchEvent& touchevent = *event.AsTouchEvent();
if (!touchevent.synchronous_handling_disabled()) {
- std::unique_ptr<ui::GestureRecognizer::Gestures> gestures;
-
Window* window = static_cast<Window*>(target);
- gestures.reset(ui::GestureRecognizer::Get()->AckTouchEvent(
- touchevent.unique_event_id(), event.result(), window));
+ ui::GestureRecognizer::Gestures gestures =
+ ui::GestureRecognizer::Get()->AckTouchEvent(
+ touchevent.unique_event_id(), event.result(), window);
- return ProcessGestures(window, gestures.get());
+ return ProcessGestures(window, std::move(gestures));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698