summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/ui_controls_win.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 21:32:30 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 21:32:30 +0000
commita4d271ecbea5ed763d49919fac7bfabe788832f6 (patch)
treec646a4d085142007968138c7ad26d1fb2aafe6a9 /chrome/browser/automation/ui_controls_win.cc
parent19ff283d0e043c59206fdc2e890a2780933849fe (diff)
downloadchromium_src-a4d271ecbea5ed763d49919fac7bfabe788832f6.zip
chromium_src-a4d271ecbea5ed763d49919fac7bfabe788832f6.tar.gz
chromium_src-a4d271ecbea5ed763d49919fac7bfabe788832f6.tar.bz2
Reverting 27412 it breaks the toolkit views Linux build.
TBR=sky Review URL: http://codereview.chromium.org/254005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27416 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/ui_controls_win.cc')
-rw-r--r--chrome/browser/automation/ui_controls_win.cc36
1 files changed, 16 insertions, 20 deletions
diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc
index 29ca089..78b1acb 100644
--- a/chrome/browser/automation/ui_controls_win.cc
+++ b/chrome/browser/automation/ui_controls_win.cc
@@ -4,10 +4,8 @@
#include "chrome/browser/automation/ui_controls.h"
-#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "base/win_util.h"
#include "base/ref_counted.h"
#include "base/task.h"
#include "views/view.h"
@@ -135,18 +133,18 @@ 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(wchar_t 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 = static_cast<WORD>(key);
input->ki.dwFlags = key_up ? KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP :
- KEYEVENTF_EXTENDEDKEY;
+ KEYEVENTF_EXTENDEDKEY;
return true;
}
// Send a key event (up/down)
-bool SendKeyEvent(base::KeyboardCode key, bool up) {
+bool SendKeyEvent(wchar_t key, bool up) {
INPUT input = { 0 };
if (!FillKeyboardInput(key, &input, up))
@@ -158,8 +156,7 @@ bool SendKeyEvent(base::KeyboardCode key, bool up) {
return true;
}
-bool SendKeyPressImpl(base::KeyboardCode key,
- bool control, bool shift, bool alt,
+bool SendKeyPressImpl(wchar_t key, bool control, bool shift, bool alt,
Task* task) {
scoped_refptr<InputDispatcher> dispatcher(
task ? new InputDispatcher(task, WM_KEYUP) : NULL);
@@ -168,19 +165,19 @@ bool SendKeyPressImpl(base::KeyboardCode key,
int i = 0;
if (control) {
- if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], false))
+ if (!FillKeyboardInput(VK_CONTROL, &input[i], false))
return false;
i++;
}
if (shift) {
- if (!FillKeyboardInput(base::VKEY_SHIFT, &input[i], false))
+ if (!FillKeyboardInput(VK_SHIFT, &input[i], false))
return false;
i++;
}
if (alt) {
- if (!FillKeyboardInput(base::VKEY_MENU, &input[i], false))
+ if (!FillKeyboardInput(VK_MENU, &input[i], false))
return false;
i++;
}
@@ -194,19 +191,19 @@ bool SendKeyPressImpl(base::KeyboardCode key,
i++;
if (alt) {
- if (!FillKeyboardInput(base::VKEY_MENU, &input[i], true))
+ if (!FillKeyboardInput(VK_MENU, &input[i], true))
return false;
i++;
}
if (shift) {
- if (!FillKeyboardInput(base::VKEY_SHIFT, &input[i], true))
+ if (!FillKeyboardInput(VK_SHIFT, &input[i], true))
return false;
i++;
}
if (control) {
- if (!FillKeyboardInput(base::VKEY_CONTROL, &input[i], true))
+ if (!FillKeyboardInput(VK_CONTROL, &input[i], true))
return false;
i++;
}
@@ -307,15 +304,14 @@ bool SendMouseEventsImpl(MouseButton type, int state, Task* task) {
// public functions -----------------------------------------------------------
-bool SendKeyPress(gfx::NativeWindow window, base::KeyboardCode key,
- bool control, bool shift, bool alt) {
+bool SendKeyPress(gfx::NativeWindow window, wchar_t key, bool control,
+ bool shift, bool alt) {
return SendKeyPressImpl(key, control, shift, alt, NULL);
}
-bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
- base::KeyboardCode key,
- bool control, bool shift, bool alt,
- Task* task) {
+bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, wchar_t key,
+ bool control, bool shift,
+ bool alt, Task* task) {
return SendKeyPressImpl(key, control, shift, alt, task);
}