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

Unified Diff: ui/events/blink/web_input_event_traits.cc

Issue 2250233002: Type->String helper function added to WebInputEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blink_Common_export instead of blink_export 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/blink/web_input_event_traits.cc
diff --git a/ui/events/blink/web_input_event_traits.cc b/ui/events/blink/web_input_event_traits.cc
index b850f5e66f01728f4e8b4b336dbcf494da9cc34b..3bf77fcbef9a98abdf9748ffcd1257554cabf7f4 100644
--- a/ui/events/blink/web_input_event_traits.cc
+++ b/ui/events/blink/web_input_event_traits.cc
@@ -108,8 +108,7 @@ struct WebInputEventToString {
template <class EventType>
bool Execute(const WebInputEvent& event, std::string* result) const {
SStringPrintf(result, "%s (Time: %lf, Modifiers: %d)\n",
- WebInputEventTraits::GetName(event.type),
- event.timeStampSeconds,
+ WebInputEvent::GetName(event.type), event.timeStampSeconds,
event.modifiers);
const EventType& typed_event = static_cast<const EventType&>(event);
ApppendEventDetails(typed_event, result);
@@ -169,54 +168,6 @@ bool Apply(Operator op,
} // namespace
-const char* WebInputEventTraits::GetName(WebInputEvent::Type type) {
-#define CASE_TYPE(t) case WebInputEvent::t: return #t
- switch(type) {
- CASE_TYPE(Undefined);
- CASE_TYPE(MouseDown);
- CASE_TYPE(MouseUp);
- CASE_TYPE(MouseMove);
- CASE_TYPE(MouseEnter);
- CASE_TYPE(MouseLeave);
- CASE_TYPE(ContextMenu);
- CASE_TYPE(MouseWheel);
- CASE_TYPE(RawKeyDown);
- CASE_TYPE(KeyDown);
- CASE_TYPE(KeyUp);
- CASE_TYPE(Char);
- CASE_TYPE(GestureScrollBegin);
- CASE_TYPE(GestureScrollEnd);
- CASE_TYPE(GestureScrollUpdate);
- CASE_TYPE(GestureFlingStart);
- CASE_TYPE(GestureFlingCancel);
- CASE_TYPE(GestureShowPress);
- CASE_TYPE(GestureTap);
- CASE_TYPE(GestureTapUnconfirmed);
- CASE_TYPE(GestureTapDown);
- CASE_TYPE(GestureTapCancel);
- CASE_TYPE(GestureDoubleTap);
- CASE_TYPE(GestureTwoFingerTap);
- CASE_TYPE(GestureLongPress);
- CASE_TYPE(GestureLongTap);
- CASE_TYPE(GesturePinchBegin);
- CASE_TYPE(GesturePinchEnd);
- CASE_TYPE(GesturePinchUpdate);
- CASE_TYPE(TouchStart);
- CASE_TYPE(TouchMove);
- CASE_TYPE(TouchEnd);
- CASE_TYPE(TouchCancel);
- CASE_TYPE(TouchScrollStarted);
- default:
- // Must include default to let blink::WebInputEvent add new event types
- // before they're added here.
- DLOG(WARNING) <<
- "Unhandled WebInputEvent type in WebInputEventTraits::GetName.\n";
- break;
- }
-#undef CASE_TYPE
- return "";
-}
-
std::string WebInputEventTraits::ToString(const WebInputEvent& event) {
std::string result;
Apply(WebInputEventToString(), event.type, event, &result);
« content/browser/android/content_view_core_impl.cc ('K') | « ui/events/blink/web_input_event_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698