diff options
Diffstat (limited to 'chrome/browser/automation/ui_controls_win.cc')
-rw-r--r-- | chrome/browser/automation/ui_controls_win.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc index 50bb88f..fdd1732 100644 --- a/chrome/browser/automation/ui_controls_win.cc +++ b/chrome/browser/automation/ui_controls_win.cc @@ -4,7 +4,8 @@ #include "chrome/browser/automation/ui_controls.h" -#include "base/keyboard_codes.h" +#include "app/keyboard_code_conversion_win.h" +#include "app/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/win_util.h" @@ -137,10 +138,10 @@ void InputDispatcher::NotifyTask() { // Populate the INPUT structure with the appropriate keyboard event // parameters required by SendInput -bool FillKeyboardInput(base::KeyboardCode key, INPUT* input, bool key_up) { +bool FillKeyboardInput(app::KeyboardCode key, INPUT* input, bool key_up) { memset(input, 0, sizeof(INPUT)); input->type = INPUT_KEYBOARD; - input->ki.wVk = win_util::KeyboardCodeToWin(key); + input->ki.wVk = app::WindowsKeyCodeForKeyboardCode(key); input->ki.dwFlags = key_up ? KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP : KEYEVENTF_EXTENDEDKEY; @@ -148,7 +149,7 @@ bool FillKeyboardInput(base::KeyboardCode key, INPUT* input, bool key_up) { } // Send a key event (up/down) -bool SendKeyEvent(base::KeyboardCode key, bool up) { +bool SendKeyEvent(app::KeyboardCode key, bool up) { INPUT input = { 0 }; if (!FillKeyboardInput(key, &input, up)) @@ -160,7 +161,7 @@ bool SendKeyEvent(base::KeyboardCode key, bool up) { return true; } -bool SendKeyPressImpl(base::KeyboardCode key, +bool SendKeyPressImpl(app::KeyboardCode key, bool control, bool shift, bool alt, Task* task) { scoped_refptr<InputDispatcher> dispatcher( @@ -171,7 +172,7 @@ bool SendKeyPressImpl(base::KeyboardCode key, // exists, send the key event directly there. HWND popup_menu = ::FindWindow(L"#32768", 0); if (popup_menu != NULL && popup_menu == ::GetTopWindow(NULL)) { - WPARAM w_param = win_util::KeyboardCodeToWin(key); + WPARAM w_param = app::WindowsKeyCodeForKeyboardCode(key); LPARAM l_param = 0; ::SendMessage(popup_menu, WM_KEYDOWN, w_param, l_param); ::SendMessage(popup_menu, WM_KEYUP, w_param, l_param); @@ -185,19 +186,19 @@ bool SendKeyPressImpl(base::KeyboardCode key, UINT i = 0; if (control) { - if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], false)) + if (!FillKeyboardInput(app::VKEY_CONTROL, &input[i], false)) return false; i++; } if (shift) { - if (!FillKeyboardInput(base::VKEY_SHIFT, &input[i], false)) + if (!FillKeyboardInput(app::VKEY_SHIFT, &input[i], false)) return false; i++; } if (alt) { - if (!FillKeyboardInput(base::VKEY_MENU, &input[i], false)) + if (!FillKeyboardInput(app::VKEY_MENU, &input[i], false)) return false; i++; } @@ -211,19 +212,19 @@ bool SendKeyPressImpl(base::KeyboardCode key, i++; if (alt) { - if (!FillKeyboardInput(base::VKEY_MENU, &input[i], true)) + if (!FillKeyboardInput(app::VKEY_MENU, &input[i], true)) return false; i++; } if (shift) { - if (!FillKeyboardInput(base::VKEY_SHIFT, &input[i], true)) + if (!FillKeyboardInput(app::VKEY_SHIFT, &input[i], true)) return false; i++; } if (control) { - if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], true)) + if (!FillKeyboardInput(app::VKEY_CONTROL, &input[i], true)) return false; i++; } @@ -322,14 +323,14 @@ bool SendMouseEventsImpl(MouseButton type, int state, Task* task) { // public functions ----------------------------------------------------------- -bool SendKeyPress(gfx::NativeWindow window, base::KeyboardCode key, +bool SendKeyPress(gfx::NativeWindow window, app::KeyboardCode key, bool control, bool shift, bool alt, bool command) { DCHECK(command == false); // No command key on Windows return SendKeyPressImpl(key, control, shift, alt, NULL); } bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - base::KeyboardCode key, + app::KeyboardCode key, bool control, bool shift, bool alt, bool command, Task* task) { |