Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: chrome/browser/automation/ui_controls_win.cc

Issue 3354005: Re-lands 58186: (Closed)
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/ui_controls_mac.mm ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/ui_controls_win.cc
diff --git a/chrome/browser/automation/ui_controls_win.cc b/chrome/browser/automation/ui_controls_win.cc
index 50bb88f6648acc6d06057e036dcd85fe58311f2d..fdd1732d2b4d685c8fbd1c5362fa4d78069e6cbe 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) {
« no previous file with comments | « chrome/browser/automation/ui_controls_mac.mm ('k') | chrome/browser/browser_focus_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698