diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 16:51:25 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 16:51:25 +0000 |
commit | 6545f1cdbbe569d404f916bef157f201028b63a0 (patch) | |
tree | 4d849f4aad386cc4cad08f94f314d78cfb7f55a5 /views/focus | |
parent | 5d451ad21fc1836a024cabecc1172c32fbe92b03 (diff) | |
download | chromium_src-6545f1cdbbe569d404f916bef157f201028b63a0.zip chromium_src-6545f1cdbbe569d404f916bef157f201028b63a0.tar.gz chromium_src-6545f1cdbbe569d404f916bef157f201028b63a0.tar.bz2 |
Adds the ability to construct a KeyEvent from a NativeEvent[2], and converts some code to use it.
Removes some of the Windows-specific stuff from KeyEvent.
BUG=72040
TEST=none
Review URL: http://codereview.chromium.org/6487002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/focus')
-rw-r--r-- | views/focus/accelerator_handler.h | 3 | ||||
-rw-r--r-- | views/focus/accelerator_handler_touch.cc | 2 | ||||
-rw-r--r-- | views/focus/accelerator_handler_win.cc | 6 |
3 files changed, 4 insertions, 7 deletions
diff --git a/views/focus/accelerator_handler.h b/views/focus/accelerator_handler.h index 96eb55d..b10b587 100644 --- a/views/focus/accelerator_handler.h +++ b/views/focus/accelerator_handler.h @@ -35,7 +35,8 @@ void SetTouchDeviceList(std::vector<unsigned int>& devices); // for the window that is receiving these messages for accelerator processing. class AcceleratorHandler : public MessageLoopForUI::Dispatcher { public: - AcceleratorHandler(); + AcceleratorHandler(); + // Dispatcher method. This returns true if an accelerator was processed by the // focus manager #if defined(OS_WIN) diff --git a/views/focus/accelerator_handler_touch.cc b/views/focus/accelerator_handler_touch.cc index ec3b750..c00edfc 100644 --- a/views/focus/accelerator_handler_touch.cc +++ b/views/focus/accelerator_handler_touch.cc @@ -164,7 +164,7 @@ bool DispatchXEvent(XEvent* xev) { switch (xev->type) { case KeyPress: case KeyRelease: { - KeyEvent keyev(xev); + KeyEvent keyev(xev, FromNativeEvent2); return root->ProcessKeyEvent(keyev); } diff --git a/views/focus/accelerator_handler_win.cc b/views/focus/accelerator_handler_win.cc index b5e4c22..ad401f3 100644 --- a/views/focus/accelerator_handler_win.cc +++ b/views/focus/accelerator_handler_win.cc @@ -24,11 +24,7 @@ bool AcceleratorHandler::Dispatch(const MSG& msg) { switch (msg.message) { case WM_KEYDOWN: case WM_SYSKEYDOWN: { - KeyEvent event(ui::ET_KEY_PRESSED, - ui::KeyboardCodeForWindowsKeyCode(msg.wParam), - KeyEvent::GetKeyStateFlags(), - msg.lParam & 0xFFFF, - (msg.lParam & 0xFFFF0000) >> 16); + KeyEvent event(msg); process_message = focus_manager->OnKeyEvent(event); if (!process_message) { // Record that this key is pressed so we can remember not to |