summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorbryeung@chromium.org <bryeung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 19:22:15 +0000
committerbryeung@chromium.org <bryeung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 19:22:15 +0000
commit2b7c9492e9a8794e2124da62bfce91fe3a1b2a77 (patch)
treef13a5c7961e2655f63916216223d16fa86454a3d /chrome/browser/automation
parent010e37516995713253daa8df6f7ba1c2b12ccd1d (diff)
downloadchromium_src-2b7c9492e9a8794e2124da62bfce91fe3a1b2a77.zip
chromium_src-2b7c9492e9a8794e2124da62bfce91fe3a1b2a77.tar.gz
chromium_src-2b7c9492e9a8794e2124da62bfce91fe3a1b2a77.tar.bz2
Revert 58215 - Revert 58186 - Move the keyboard files from base/ to app/.
Also moves the associated classes/enums from base:: to app::. TEST=try bots compile BUG=NONE Review URL: http://codereview.chromium.org/3165064 TBR=bryeung@chromium.org TBR=phajdan.jr@chromium.org Review URL: http://codereview.chromium.org/3361003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc1
-rw-r--r--chrome/browser/automation/automation_provider_win.cc4
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc2
-rw-r--r--chrome/browser/automation/ui_controls.h6
-rw-r--r--chrome/browser/automation/ui_controls_linux.cc8
-rw-r--r--chrome/browser/automation/ui_controls_mac.mm32
-rw-r--r--chrome/browser/automation/ui_controls_win.cc29
7 files changed, 41 insertions, 41 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index e2f5d12..8a27a77 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -12,7 +12,6 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/json/string_escape.h"
-#include "base/keyboard_codes.h"
#include "base/message_loop.h"
#include "base/path_service.h"
#include "base/process_util.h"
diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc
index 41994e8..3495991 100644
--- a/chrome/browser/automation/automation_provider_win.cc
+++ b/chrome/browser/automation/automation_provider_win.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/automation/automation_provider.h"
+#include "app/keyboard_codes.h"
#include "base/json/json_reader.h"
-#include "base/keyboard_codes.h"
#include "base/trace_event.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/automation/automation_browser_tracker.h"
@@ -200,7 +200,7 @@ void AutomationProvider::WindowSimulateDrag(int handle,
if (press_escape_en_route) {
// Press Escape.
- ui_controls::SendKeyPress(window, base::VKEY_ESCAPE,
+ ui_controls::SendKeyPress(window, app::VKEY_ESCAPE,
((flags & views::Event::EF_CONTROL_DOWN)
== views::Event::EF_CONTROL_DOWN),
((flags & views::Event::EF_SHIFT_DOWN) ==
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index b5cb004..0a0e100 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -879,7 +879,7 @@ void TestingAutomationProvider::WindowSimulateKeyPress(
gfx::NativeWindow window = window_tracker_->GetResource(handle);
// The key event is sent to whatever window is active.
- ui_controls::SendKeyPress(window, static_cast<base::KeyboardCode>(key),
+ ui_controls::SendKeyPress(window, static_cast<app::KeyboardCode>(key),
((flags & views::Event::EF_CONTROL_DOWN) ==
views::Event::EF_CONTROL_DOWN),
((flags & views::Event::EF_SHIFT_DOWN) ==
diff --git a/chrome/browser/automation/ui_controls.h b/chrome/browser/automation/ui_controls.h
index 2b26dfe..3664567 100644
--- a/chrome/browser/automation/ui_controls.h
+++ b/chrome/browser/automation/ui_controls.h
@@ -12,7 +12,7 @@
#include <wtypes.h>
#endif
-#include "base/keyboard_codes.h"
+#include "app/keyboard_codes.h"
#include "gfx/native_widget_types.h"
#include "gfx/point.h"
@@ -46,13 +46,13 @@ namespace ui_controls {
// If you're writing a test chances are you want the variant in ui_test_utils.
// See it for details.
bool SendKeyPress(gfx::NativeWindow window,
- base::KeyboardCode key,
+ app::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command);
bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
- base::KeyboardCode key,
+ app::KeyboardCode key,
bool control,
bool shift,
bool alt,
diff --git a/chrome/browser/automation/ui_controls_linux.cc b/chrome/browser/automation/ui_controls_linux.cc
index bdf71df..a2dd0ae 100644
--- a/chrome/browser/automation/ui_controls_linux.cc
+++ b/chrome/browser/automation/ui_controls_linux.cc
@@ -7,8 +7,8 @@
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#include "app/event_synthesis_gtk.h"
#include "gfx/rect.h"
-#include "base/event_synthesis_gtk.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "chrome/browser/automation/ui_controls_internal.h"
@@ -96,7 +96,7 @@ void FakeAMouseMotionEvent(gint x, gint y) {
namespace ui_controls {
bool SendKeyPress(gfx::NativeWindow window,
- base::KeyboardCode key,
+ app::KeyboardCode key,
bool control, bool shift, bool alt, bool command) {
DCHECK(command == false); // No command key on Linux
GdkWindow* event_window = NULL;
@@ -124,7 +124,7 @@ bool SendKeyPress(gfx::NativeWindow window,
}
std::vector<GdkEvent*> events;
- base::SynthesizeKeyPressEvents(event_window, key, control, shift, alt,
+ app::SynthesizeKeyPressEvents(event_window, key, control, shift, alt,
&events);
for (std::vector<GdkEvent*>::iterator iter = events.begin();
iter != events.end(); ++iter) {
@@ -137,7 +137,7 @@ bool SendKeyPress(gfx::NativeWindow window,
}
bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
- base::KeyboardCode key,
+ app::KeyboardCode key,
bool control, bool shift,
bool alt, bool command,
Task* task) {
diff --git a/chrome/browser/automation/ui_controls_mac.mm b/chrome/browser/automation/ui_controls_mac.mm
index d95dbc2..5edfa5d 100644
--- a/chrome/browser/automation/ui_controls_mac.mm
+++ b/chrome/browser/automation/ui_controls_mac.mm
@@ -8,7 +8,7 @@
#include <mach/mach_time.h>
#include <vector>
-#include "base/keyboard_code_conversion_mac.h"
+#include "app/keyboard_code_conversion_mac.h"
#include "base/message_loop.h"
#include "chrome/browser/automation/ui_controls_internal.h"
#include "chrome/browser/chrome_thread.h"
@@ -76,11 +76,11 @@ NSTimeInterval TimeIntervalSinceSystemStartup() {
// Creates and returns an autoreleased key event.
NSEvent* SynthesizeKeyEvent(NSWindow* window,
bool keyDown,
- base::KeyboardCode keycode,
+ app::KeyboardCode keycode,
NSUInteger flags) {
unichar character;
unichar characterIgnoringModifiers;
- int macKeycode = base::MacKeyCodeForWindowsKeyCode(
+ int macKeycode = app::MacKeyCodeForWindowsKeyCode(
keycode, flags, &character, &characterIgnoringModifiers);
if (macKeycode < 0)
@@ -97,8 +97,8 @@ NSEvent* SynthesizeKeyEvent(NSWindow* window,
// Modifier keys generate NSFlagsChanged event rather than
// NSKeyDown/NSKeyUp events.
- if (keycode == base::VKEY_CONTROL || keycode == base::VKEY_SHIFT ||
- keycode == base::VKEY_MENU || keycode == base::VKEY_COMMAND)
+ if (keycode == app::VKEY_CONTROL || keycode == app::VKEY_SHIFT ||
+ keycode == app::VKEY_MENU || keycode == app::VKEY_COMMAND)
type = NSFlagsChanged;
// For events other than mouse moved, [event locationInWindow] is
@@ -121,7 +121,7 @@ NSEvent* SynthesizeKeyEvent(NSWindow* window,
// Creates the proper sequence of autoreleased key events for a key down + up.
void SynthesizeKeyEventsSequence(NSWindow* window,
- base::KeyboardCode keycode,
+ app::KeyboardCode keycode,
bool control,
bool shift,
bool alt,
@@ -131,25 +131,25 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
NSUInteger flags = 0;
if (control) {
flags |= NSControlKeyMask;
- event = SynthesizeKeyEvent(window, true, base::VKEY_CONTROL, flags);
+ event = SynthesizeKeyEvent(window, true, app::VKEY_CONTROL, flags);
DCHECK(event);
events->push_back(event);
}
if (shift) {
flags |= NSShiftKeyMask;
- event = SynthesizeKeyEvent(window, true, base::VKEY_SHIFT, flags);
+ event = SynthesizeKeyEvent(window, true, app::VKEY_SHIFT, flags);
DCHECK(event);
events->push_back(event);
}
if (alt) {
flags |= NSAlternateKeyMask;
- event = SynthesizeKeyEvent(window, true, base::VKEY_MENU, flags);
+ event = SynthesizeKeyEvent(window, true, app::VKEY_MENU, flags);
DCHECK(event);
events->push_back(event);
}
if (command) {
flags |= NSCommandKeyMask;
- event = SynthesizeKeyEvent(window, true, base::VKEY_COMMAND, flags);
+ event = SynthesizeKeyEvent(window, true, app::VKEY_COMMAND, flags);
DCHECK(event);
events->push_back(event);
}
@@ -163,25 +163,25 @@ void SynthesizeKeyEventsSequence(NSWindow* window,
if (command) {
flags &= ~NSCommandKeyMask;
- event = SynthesizeKeyEvent(window, false, base::VKEY_COMMAND, flags);
+ event = SynthesizeKeyEvent(window, false, app::VKEY_COMMAND, flags);
DCHECK(event);
events->push_back(event);
}
if (alt) {
flags &= ~NSAlternateKeyMask;
- event = SynthesizeKeyEvent(window, false, base::VKEY_MENU, flags);
+ event = SynthesizeKeyEvent(window, false, app::VKEY_MENU, flags);
DCHECK(event);
events->push_back(event);
}
if (shift) {
flags &= ~NSShiftKeyMask;
- event = SynthesizeKeyEvent(window, false, base::VKEY_SHIFT, flags);
+ event = SynthesizeKeyEvent(window, false, app::VKEY_SHIFT, flags);
DCHECK(event);
events->push_back(event);
}
if (control) {
flags &= ~NSControlKeyMask;
- event = SynthesizeKeyEvent(window, false, base::VKEY_CONTROL, flags);
+ event = SynthesizeKeyEvent(window, false, app::VKEY_CONTROL, flags);
DCHECK(event);
events->push_back(event);
}
@@ -221,7 +221,7 @@ NSPoint g_mouse_location = { 0, 0 };
namespace ui_controls {
bool SendKeyPress(gfx::NativeWindow window,
- base::KeyboardCode key,
+ app::KeyboardCode key,
bool control,
bool shift,
bool alt,
@@ -234,7 +234,7 @@ bool SendKeyPress(gfx::NativeWindow window,
// Win and Linux implement a SendKeyPress() this as a
// SendKeyPressAndRelease(), so we should as well (despite the name).
bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
- base::KeyboardCode key,
+ app::KeyboardCode key,
bool control,
bool shift,
bool alt,
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) {