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

Unified Diff: ui/base/event.h

Issue 10827271: Replace views::Event with ui::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « ui/app_list/search_result_list_view.cc ('k') | ui/base/event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/event.h
===================================================================
--- ui/base/event.h (revision 151055)
+++ ui/base/event.h (working copy)
@@ -20,6 +20,12 @@
namespace ui {
class Transform;
+#if defined(USE_AURA)
+typedef Event* NativeEvent;
+#else
+typedef base::NativeEvent NativeEvent;
+#endif
+
class UI_EXPORT Event {
public:
virtual ~Event();
@@ -39,6 +45,7 @@
};
const base::NativeEvent& native_event() const { return native_event_; }
+ const ui::NativeEvent& ui_native_event() const { return ui_native_event_; }
EventType type() const { return type_; }
// time_stamp represents time since machine was booted.
const base::TimeDelta& time_stamp() const { return time_stamp_; }
@@ -55,6 +62,35 @@
bool IsCapsLockDown() const { return (flags_ & EF_CAPS_LOCK_DOWN) != 0; }
bool IsAltDown() const { return (flags_ & EF_ALT_DOWN) != 0; }
+ bool IsMouseEvent() const {
+ return type_ == ui::ET_MOUSE_PRESSED ||
+ type_ == ui::ET_MOUSE_DRAGGED ||
+ type_ == ui::ET_MOUSE_RELEASED ||
+ type_ == ui::ET_MOUSE_MOVED ||
+ type_ == ui::ET_MOUSE_ENTERED ||
+ type_ == ui::ET_MOUSE_EXITED ||
+ type_ == ui::ET_MOUSEWHEEL;
+ }
+
+ bool IsTouchEvent() const {
+ return type_ == ui::ET_TOUCH_RELEASED ||
+ type_ == ui::ET_TOUCH_PRESSED ||
+ type_ == ui::ET_TOUCH_MOVED ||
+ type_ == ui::ET_TOUCH_STATIONARY ||
+ type_ == ui::ET_TOUCH_CANCELLED;
+ }
+
+ bool IsScrollGestureEvent() const {
+ return type_ == ui::ET_GESTURE_SCROLL_BEGIN ||
+ type_ == ui::ET_GESTURE_SCROLL_UPDATE ||
+ type_ == ui::ET_GESTURE_SCROLL_END;
+ }
+
+ bool IsFlingScrollEvent() const {
+ return type_ == ui::ET_SCROLL_FLING_CANCEL ||
+ type_ == ui::ET_SCROLL_FLING_START;
+ }
+
// Returns true if the event has a valid |native_event_|.
bool HasNativeEvent() const;
@@ -76,6 +112,8 @@
void InitWithNativeEvent(const base::NativeEvent& native_event);
base::NativeEvent native_event_;
+ // TODO(beng): check to see if this is necessary.
+ ui::NativeEvent ui_native_event_;
EventType type_;
base::TimeDelta time_stamp_;
int flags_;
« no previous file with comments | « ui/app_list/search_result_list_view.cc ('k') | ui/base/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698