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

Unified Diff: third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp

Issue 2683043004: Remove ui/events/blink dependency on blink_minimal. (Closed)
Patch Set: fix win debug Created 3 years, 10 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: third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp b/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp
index 3fc631c87821acfed3dcee122000563651bf1bbe..5bc63ac0ed4961ef54b62f11de457a3f7fdceef5 100644
--- a/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp
@@ -13,31 +13,6 @@ namespace blink {
namespace {
-WebScopedInputEvent makeWebScopedInputEvent(const blink::WebInputEvent& event) {
- if (blink::WebInputEvent::isGestureEventType(event.type())) {
- return WebScopedInputEvent(new blink::WebGestureEvent(
- static_cast<const blink::WebGestureEvent&>(event)));
- }
- if (blink::WebInputEvent::isMouseEventType(event.type())) {
- return WebScopedInputEvent(new blink::WebMouseEvent(
- static_cast<const blink::WebMouseEvent&>(event)));
- }
- if (blink::WebInputEvent::isTouchEventType(event.type())) {
- return WebScopedInputEvent(new blink::WebTouchEvent(
- static_cast<const blink::WebTouchEvent&>(event)));
- }
- if (event.type() == blink::WebInputEvent::MouseWheel) {
- return WebScopedInputEvent(new blink::WebMouseWheelEvent(
- static_cast<const blink::WebMouseWheelEvent&>(event)));
- }
- if (blink::WebInputEvent::isKeyboardEventType(event.type())) {
- return WebScopedInputEvent(new blink::WebKeyboardEvent(
- static_cast<const blink::WebKeyboardEvent&>(event)));
- }
- NOTREACHED();
- return WebScopedInputEvent();
-}
-
struct WebInputEventDelete {
template <class EventType>
bool Execute(WebInputEvent* event) const {
@@ -67,7 +42,8 @@ bool Apply(Operator op, WebInputEvent::Type type, const ArgIn& argIn) {
}
}
-void WebInputEventDeleter::operator()(WebInputEvent* event) const {
+void WebCoalescedInputEvent::WebInputEventDeleter::operator()(
+ WebInputEvent* event) const {
if (!event)
return;
Apply(WebInputEventDelete(), event->type(), event);
@@ -103,11 +79,6 @@ WebCoalescedInputEvent::getCoalescedEventsPointers() const {
return events;
}
-WebCoalescedInputEvent::WebCoalescedInputEvent(WebScopedInputEvent event)
- : m_event(std::move(event)) {
- m_coalescedEvents.push_back(makeWebScopedInputEvent(*(m_event.get())));
-}
-
WebCoalescedInputEvent::WebCoalescedInputEvent(const WebInputEvent& event) {
m_event = makeWebScopedInputEvent(event);
m_coalescedEvents.push_back(makeWebScopedInputEvent(event));
@@ -121,4 +92,31 @@ WebCoalescedInputEvent::WebCoalescedInputEvent(
m_coalescedEvents.push_back(makeWebScopedInputEvent(*coalescedEvent));
}
+WebCoalescedInputEvent::WebScopedInputEvent
+WebCoalescedInputEvent::makeWebScopedInputEvent(
+ const blink::WebInputEvent& event) {
+ if (blink::WebInputEvent::isGestureEventType(event.type())) {
+ return WebScopedInputEvent(new blink::WebGestureEvent(
+ static_cast<const blink::WebGestureEvent&>(event)));
+ }
+ if (blink::WebInputEvent::isMouseEventType(event.type())) {
+ return WebScopedInputEvent(new blink::WebMouseEvent(
+ static_cast<const blink::WebMouseEvent&>(event)));
+ }
+ if (blink::WebInputEvent::isTouchEventType(event.type())) {
+ return WebScopedInputEvent(new blink::WebTouchEvent(
+ static_cast<const blink::WebTouchEvent&>(event)));
+ }
+ if (event.type() == blink::WebInputEvent::MouseWheel) {
+ return WebScopedInputEvent(new blink::WebMouseWheelEvent(
+ static_cast<const blink::WebMouseWheelEvent&>(event)));
+ }
+ if (blink::WebInputEvent::isKeyboardEventType(event.type())) {
+ return WebScopedInputEvent(new blink::WebKeyboardEvent(
+ static_cast<const blink::WebKeyboardEvent&>(event)));
+ }
+ NOTREACHED();
+ return WebScopedInputEvent();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698