Index: ui/aura/event.cc |
diff --git a/ui/aura/event.cc b/ui/aura/event.cc |
index 5cb2fd8f1f756f819cd9f1c9a29e550c2dde013a..3348b3f0336111c1ea7e259bed22724d8f99a382 100644 |
--- a/ui/aura/event.cc |
+++ b/ui/aura/event.cc |
@@ -8,6 +8,8 @@ |
#include <X11/Xlib.h> |
#endif |
+#include <cstring> |
+ |
#include "ui/aura/window.h" |
#include "ui/base/keycodes/keyboard_code_conversion.h" |
#include "ui/gfx/point3.h" |
@@ -78,7 +80,13 @@ Event::Event(const Event& copy) |
} |
void Event::Init() { |
- memset(&native_event_, 0, sizeof(native_event_)); |
+ std::memset(&native_event_, 0, sizeof(native_event_)); |
+} |
+ |
+bool Event::HasNativeEvent() const { |
+ base::NativeEvent null_event; |
+ std::memset(&null_event, 0, sizeof(null_event)); |
+ return !!std::memcmp(&native_event_, &null_event, sizeof(null_event)); |
} |
void Event::InitWithNativeEvent(const base::NativeEvent& native_event) { |