summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-11 05:59:47 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-11 05:59:47 +0000
commit73fd880f0fc45d25af70260ff54f240e248ff4be (patch)
tree31c9d0512a41d8616cade27b24a4fe96b281677f /views
parent3f224b4440a33ba0b1b7ca32894cd374fb905946 (diff)
downloadchromium_src-73fd880f0fc45d25af70260ff54f240e248ff4be.zip
chromium_src-73fd880f0fc45d25af70260ff54f240e248ff4be.tar.gz
chromium_src-73fd880f0fc45d25af70260ff54f240e248ff4be.tar.bz2
Refactor TOUCH_UI to match other refactor.
A few files were missed in a previous refactor (http://codereview.chromium.org/6480001/). BUG=72040 TEST=none Review URL: http://codereview.chromium.org/6488006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/focus/accelerator_handler_touch.cc6
-rw-r--r--views/native_types.h13
-rw-r--r--views/touchui/gesture_manager.cc12
-rw-r--r--views/view_unittest.cc8
4 files changed, 21 insertions, 18 deletions
diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc
index 65cc2e7..9b588c1 100644
--- a/views/focus/accelerator_handler_touch.cc
+++ b/views/focus/accelerator_handler_touch.cc
@@ -99,7 +99,7 @@ bool DispatchX2Event(RootView* root, XEvent* xev) {
if (!touch_event) {
// Show the cursor, and decide whether or not the cursor should be
// automatically hidden after a certain time of inactivity.
- int button_flags = mouseev.GetFlags() & (ui::EF_RIGHT_BUTTON_DOWN |
+ int button_flags = mouseev.flags() & (ui::EF_RIGHT_BUTTON_DOWN |
ui::EF_MIDDLE_BUTTON_DOWN | ui::EF_LEFT_BUTTON_DOWN);
bool start_timer = false;
@@ -130,7 +130,7 @@ bool DispatchX2Event(RootView* root, XEvent* xev) {
root->OnMouseReleased(mouseev, false);
return true;
case XI_Motion: {
- if (mouseev.GetType() == ui::ET_MOUSE_DRAGGED) {
+ if (mouseev.type() == ui::ET_MOUSE_DRAGGED) {
return root->OnMouseDragged(mouseev);
} else {
root->OnMouseMoved(mouseev);
@@ -188,7 +188,7 @@ bool DispatchXEvent(XEvent* xev) {
case MotionNotify: {
MouseEvent mouseev(xev);
- if (mouseev.GetType() == ui::ET_MOUSE_DRAGGED) {
+ if (mouseev.type() == ui::ET_MOUSE_DRAGGED) {
return root->OnMouseDragged(mouseev);
} else {
root->OnMouseMoved(mouseev);
diff --git a/views/native_types.h b/views/native_types.h
index abea52e..d61ca96 100644
--- a/views/native_types.h
+++ b/views/native_types.h
@@ -8,18 +8,21 @@
#include "ui/gfx/native_widget_types.h"
+#if defined(TOUCH_UI)
+typedef union _XEvent XEvent;
+#elif defined(OS_LINUX)
+typedef union _GdkEvent GdkEvent;
+#endif
+
namespace views {
#if defined(OS_WIN)
typedef MSG NativeEvent;
#endif
-#if defined(OS_LINUX)
-typedef union _GdkEvent GdkEvent;
-typedef GdkEvent* NativeEvent;
-#endif
#if defined(TOUCH_UI)
-typedef union _XEvent XEvent;
typedef XEvent* NativeEvent;
+#elif defined(OS_LINUX)
+typedef GdkEvent* NativeEvent;
#endif
} // namespace views
diff --git a/views/touchui/gesture_manager.cc b/views/touchui/gesture_manager.cc
index bc4fdd5..2d6c7d0 100644
--- a/views/touchui/gesture_manager.cc
+++ b/views/touchui/gesture_manager.cc
@@ -30,26 +30,26 @@ bool GestureManager::ProcessTouchEventForGesture(const TouchEvent& event,
// appear in a subsequent CL. This interim version permits verifying that the
// event distribution code works by turning all touch inputs into
// mouse approximations.
- if (event.GetType() == ui::ET_TOUCH_PRESSED) {
+ if (event.type() == ui::ET_TOUCH_PRESSED) {
DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchPressed";
MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, event.x(), event.y(),
- event.GetFlags());
+ event.flags());
source->OnMousePressed(mouse_event);
return true;
}
- if (event.GetType() == ui::ET_TOUCH_RELEASED) {
+ if (event.type() == ui::ET_TOUCH_RELEASED) {
DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchReleased";
MouseEvent mouse_event(ui::ET_MOUSE_RELEASED, event.x(), event.y(),
- event.GetFlags());
+ event.flags());
source->OnMouseReleased(mouse_event, false);
return true;
}
- if (event.GetType() == ui::ET_TOUCH_MOVED) {
+ if (event.type() == ui::ET_TOUCH_MOVED) {
DVLOG(1) << "GestureManager::ProcessTouchEventForGesture: TouchMotion";
MouseEvent mouse_event(ui::ET_MOUSE_DRAGGED, event.x(), event.y(),
- event.GetFlags());
+ event.flags());
source->OnMouseDragged(mouse_event);
return true;
}
diff --git a/views/view_unittest.cc b/views/view_unittest.cc
index bee547d..111554b 100644
--- a/views/view_unittest.cc
+++ b/views/view_unittest.cc
@@ -415,7 +415,7 @@ bool MockGestureManager::ProcessTouchEventForGesture(
dispatched_synthetic_event_ = false;
return false;
}
- last_touch_event_ = event.GetType();
+ last_touch_event_ = event.type();
last_view_ = source;
previously_handled_flag_ = status != View::TOUCH_STATUS_UNKNOWN;
dispatched_synthetic_event_ = true;
@@ -426,15 +426,15 @@ MockGestureManager::MockGestureManager() {
}
View::TouchStatus TestView::OnTouchEvent(const TouchEvent& event) {
- last_touch_event_type_ = event.GetType();
+ last_touch_event_type_ = event.type();
location_.SetPoint(event.x(), event.y());
if (!in_touch_sequence_) {
- if (event.GetType() == ui::ET_TOUCH_PRESSED) {
+ if (event.type() == ui::ET_TOUCH_PRESSED) {
in_touch_sequence_ = true;
return TOUCH_STATUS_START;
}
} else {
- if (event.GetType() == ui::ET_TOUCH_RELEASED) {
+ if (event.type() == ui::ET_TOUCH_RELEASED) {
in_touch_sequence_ = false;
return TOUCH_STATUS_END;
}