summaryrefslogtreecommitdiffstats
path: root/ui/views/events
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 04:56:36 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-10 04:56:36 +0000
commit8d577a70f6e6d2e47f0ac32f8606e489a7a77998 (patch)
tree48eae3f525e0323362db629efa2589e70a5a4e49 /ui/views/events
parent8fb0ecf45b286845fd2004a157a294d7e3ca7a39 (diff)
downloadchromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.zip
chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.tar.gz
chromium_src-8d577a70f6e6d2e47f0ac32f8606e489a7a77998.tar.bz2
Migrate Event API methods to Google Style.
Re-landing, moving the bits Mac uses to ui/base/events.h BUG=72040 TEST=none TBR=sky Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=74377 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74408 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/events')
-rw-r--r--ui/views/events/event_win.cc52
1 files changed, 26 insertions, 26 deletions
diff --git a/ui/views/events/event_win.cc b/ui/views/events/event_win.cc
index 10a4b55..15d92009 100644
--- a/ui/views/events/event_win.cc
+++ b/ui/views/events/event_win.cc
@@ -19,30 +19,30 @@ namespace {
int GetKeyStateFlags() {
int flags = 0;
if (GetKeyState(VK_MENU) & 0x80)
- flags |= Event::EF_ALT_DOWN;
+ flags |= ui::EF_ALT_DOWN;
if (GetKeyState(VK_SHIFT) & 0x80)
- flags |= Event::EF_SHIFT_DOWN;
+ flags |= ui::EF_SHIFT_DOWN;
if (GetKeyState(VK_CONTROL) & 0x80)
- flags |= Event::EF_CONTROL_DOWN;
+ flags |= ui::EF_CONTROL_DOWN;
return flags;
}
// Convert windows message identifiers to Event types.
-Event::EventType EventTypeFromNative(NativeEvent native_event) {
+ui::EventType EventTypeFromNative(NativeEvent native_event) {
switch (native_event.message) {
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
- return Event::ET_KEY_PRESSED;
+ return ui::ET_KEY_PRESSED;
case WM_KEYUP:
case WM_SYSKEYUP:
- return Event::ET_KEY_RELEASED;
+ return ui::ET_KEY_RELEASED;
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
case WM_NCLBUTTONDOWN:
case WM_NCMBUTTONDOWN:
case WM_NCRBUTTONDOWN:
case WM_RBUTTONDOWN:
- return Event::ET_MOUSE_PRESSED;
+ return ui::ET_MOUSE_PRESSED;
case WM_LBUTTONDBLCLK:
case WM_LBUTTONUP:
case WM_MBUTTONDBLCLK:
@@ -55,19 +55,19 @@ Event::EventType EventTypeFromNative(NativeEvent native_event) {
case WM_NCRBUTTONUP:
case WM_RBUTTONDBLCLK:
case WM_RBUTTONUP:
- return Event::ET_MOUSE_RELEASED;
+ return ui::ET_MOUSE_RELEASED;
case WM_MOUSEMOVE:
case WM_NCMOUSEMOVE:
- return Event::ET_MOUSE_MOVED;
+ return ui::ET_MOUSE_MOVED;
case WM_MOUSEWHEEL:
- return Event::ET_MOUSEWHEEL;
+ return ui::ET_MOUSEWHEEL;
case WM_MOUSELEAVE:
case WM_NCMOUSELEAVE:
- return Event::ET_MOUSE_EXITED;
+ return ui::ET_MOUSE_EXITED;
default:
NOTREACHED();
}
- return Event::ET_UNKNOWN;
+ return ui::ET_UNKNOWN;
}
bool IsClientMouseEvent(NativeEvent native_event) {
@@ -102,7 +102,7 @@ int MouseEventFlagsFromNative(NativeEvent native_event) {
// Check if the event occurred in the non-client area.
if (IsNonClientMouseEvent(native_event))
- flags |= MouseEvent::EF_IS_NON_CLIENT;
+ flags |= ui::EF_IS_NON_CLIENT;
// Check for double click events.
switch (native_event.message) {
@@ -112,28 +112,28 @@ int MouseEventFlagsFromNative(NativeEvent native_event) {
case WM_LBUTTONDBLCLK:
case WM_MBUTTONDBLCLK:
case WM_RBUTTONDBLCLK:
- flags |= MouseEvent::EF_IS_DOUBLE_CLICK;
+ flags |= ui::EF_IS_DOUBLE_CLICK;
break;
}
// Check for pressed buttons.
if (IsClientMouseEvent(native_event)) {
if (native_event.wParam & MK_LBUTTON)
- flags |= Event::EF_LEFT_BUTTON_DOWN;
+ flags |= ui::EF_LEFT_BUTTON_DOWN;
if (native_event.wParam & MK_MBUTTON)
- flags |= Event::EF_MIDDLE_BUTTON_DOWN;
+ flags |= ui::EF_MIDDLE_BUTTON_DOWN;
if (native_event.wParam & MK_RBUTTON)
- flags |= Event::EF_RIGHT_BUTTON_DOWN;
+ flags |= ui::EF_RIGHT_BUTTON_DOWN;
} else if (IsNonClientMouseEvent(native_event)) {
switch (native_event.message) {
case WM_NCLBUTTONDOWN:
- flags |= Event::EF_LEFT_BUTTON_DOWN;
+ flags |= ui::EF_LEFT_BUTTON_DOWN;
break;
case WM_NCMBUTTONDOWN:
- flags |= Event::EF_MIDDLE_BUTTON_DOWN;
+ flags |= ui::EF_MIDDLE_BUTTON_DOWN;
break;
case WM_NCRBUTTONDOWN:
- flags |= Event::EF_RIGHT_BUTTON_DOWN;
+ flags |= ui::EF_RIGHT_BUTTON_DOWN;
break;
}
}
@@ -146,17 +146,17 @@ int MouseWheelEventFlagsFromNative(NativeEvent native_event) {
int native_flags = GET_KEYSTATE_WPARAM(native_event.wParam);
int flags = 0;
if (native_flags & MK_CONTROL)
- flags |= Event::EF_CONTROL_DOWN;
+ flags |= ui::EF_CONTROL_DOWN;
if (native_flags & MK_SHIFT)
- flags |= Event::EF_SHIFT_DOWN;
+ flags |= ui::EF_SHIFT_DOWN;
if (GetKeyState(VK_MENU) < 0)
- flags |= Event::EF_ALT_DOWN;
+ flags |= ui::EF_ALT_DOWN;
if (native_flags & MK_LBUTTON)
- flags |= Event::EF_LEFT_BUTTON_DOWN;
+ flags |= ui::EF_LEFT_BUTTON_DOWN;
if (native_flags & MK_MBUTTON)
- flags |= Event::EF_MIDDLE_BUTTON_DOWN;
+ flags |= ui::EF_MIDDLE_BUTTON_DOWN;
if (native_flags & MK_RBUTTON)
- flags |= Event::EF_RIGHT_BUTTON_DOWN;
+ flags |= ui::EF_RIGHT_BUTTON_DOWN;
return flags;
}