diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 17:36:09 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-13 17:36:09 +0000 |
commit | b6d81261a469240e25b41e7125bb7166ca3d35bb (patch) | |
tree | 9ddaf52100915560ce5c3d0167e79ef4a26aec56 /chrome/browser/automation | |
parent | 917a44b0724089630cb1d962a9383df7a1deaf7e (diff) | |
download | chromium_src-b6d81261a469240e25b41e7125bb7166ca3d35bb.zip chromium_src-b6d81261a469240e25b41e7125bb7166ca3d35bb.tar.gz chromium_src-b6d81261a469240e25b41e7125bb7166ca3d35bb.tar.bz2 |
Move app/key* to ui/base/keycodes/*
BUG=none
TEST=none
TBR=brettw
Review URL: http://codereview.chromium.org/6246001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r-- | chrome/browser/automation/automation_provider_win.cc | 4 | ||||
-rw-r--r-- | chrome/browser/automation/testing_automation_provider.cc | 2 | ||||
-rw-r--r-- | chrome/browser/automation/ui_controls.h | 6 | ||||
-rw-r--r-- | chrome/browser/automation/ui_controls_linux.cc | 4 | ||||
-rw-r--r-- | chrome/browser/automation/ui_controls_mac.mm | 32 | ||||
-rw-r--r-- | chrome/browser/automation/ui_controls_win.cc | 30 |
6 files changed, 39 insertions, 39 deletions
diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index a2d142a..5646c75 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -4,7 +4,6 @@ #include "chrome/browser/automation/automation_provider.h" -#include "app/keyboard_codes.h" #include "base/debug/trace_event.h" #include "base/json/json_reader.h" #include "base/utf_string_conversions.h" @@ -24,6 +23,7 @@ #include "chrome/browser/ui/views/bookmark_bar_view.h" #include "chrome/common/automation_messages.h" #include "chrome/common/page_zoom.h" +#include "ui/base/keycodes/keyboard_codes.h" #include "views/focus/accelerator_handler.h" #include "views/widget/root_view.h" #include "views/widget/widget_win.h" @@ -203,7 +203,7 @@ void AutomationProvider::WindowSimulateDrag(int handle, // Press Escape, making sure we wait until chrome processes the escape. // TODO(phajdan.jr): make this use ui_test_utils::SendKeyPressSync. ui_controls::SendKeyPressNotifyWhenDone( - window, app::VKEY_ESCAPE, + window, ui::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 9b6c303..9012d3c 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -869,7 +869,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<app::KeyboardCode>(key), + ui_controls::SendKeyPress(window, static_cast<ui::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 3664567..25fa4f6 100644 --- a/chrome/browser/automation/ui_controls.h +++ b/chrome/browser/automation/ui_controls.h @@ -12,9 +12,9 @@ #include <wtypes.h> #endif -#include "app/keyboard_codes.h" #include "gfx/native_widget_types.h" #include "gfx/point.h" +#include "ui/base/keycodes/keyboard_codes.h" #if defined(TOOLKIT_VIEWS) namespace views { @@ -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, - app::KeyboardCode key, + ui::KeyboardCode key, bool control, bool shift, bool alt, bool command); bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - app::KeyboardCode key, + ui::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 21cd0dd..1b814e5 100644 --- a/chrome/browser/automation/ui_controls_linux.cc +++ b/chrome/browser/automation/ui_controls_linux.cc @@ -96,7 +96,7 @@ void FakeAMouseMotionEvent(gint x, gint y) { namespace ui_controls { bool SendKeyPress(gfx::NativeWindow window, - app::KeyboardCode key, + ui::KeyboardCode key, bool control, bool shift, bool alt, bool command) { DCHECK(command == false); // No command key on Linux GdkWindow* event_window = NULL; @@ -137,7 +137,7 @@ bool SendKeyPress(gfx::NativeWindow window, } bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, - app::KeyboardCode key, + ui::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 03f7e2c..6e8bcc9 100644 --- a/chrome/browser/automation/ui_controls_mac.mm +++ b/chrome/browser/automation/ui_controls_mac.mm @@ -8,10 +8,10 @@ #include <mach/mach_time.h> #include <vector> -#include "app/keyboard_code_conversion_mac.h" #include "base/message_loop.h" #include "chrome/browser/automation/ui_controls_internal.h" #include "chrome/browser/browser_thread.h" +#include "ui/base/keycodes/keyboard_code_conversion_mac.h" // Implementation details: We use [NSApplication sendEvent:] instead // of [NSApplication postEvent:atStart:] so that the event gets sent @@ -76,11 +76,11 @@ NSTimeInterval TimeIntervalSinceSystemStartup() { // Creates and returns an autoreleased key event. NSEvent* SynthesizeKeyEvent(NSWindow* window, bool keyDown, - app::KeyboardCode keycode, + ui::KeyboardCode keycode, NSUInteger flags) { unichar character; unichar characterIgnoringModifiers; - int macKeycode = app::MacKeyCodeForWindowsKeyCode( + int macKeycode = ui::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 == app::VKEY_CONTROL || keycode == app::VKEY_SHIFT || - keycode == app::VKEY_MENU || keycode == app::VKEY_COMMAND) + if (keycode == ui::VKEY_CONTROL || keycode == ui::VKEY_SHIFT || + keycode == ui::VKEY_MENU || keycode == ui::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, - app::KeyboardCode keycode, + ui::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, app::VKEY_CONTROL, flags); + event = SynthesizeKeyEvent(window, true, ui::VKEY_CONTROL, flags); DCHECK(event); events->push_back(event); } if (shift) { flags |= NSShiftKeyMask; - event = SynthesizeKeyEvent(window, true, app::VKEY_SHIFT, flags); + event = SynthesizeKeyEvent(window, true, ui::VKEY_SHIFT, flags); DCHECK(event); events->push_back(event); } if (alt) { flags |= NSAlternateKeyMask; - event = SynthesizeKeyEvent(window, true, app::VKEY_MENU, flags); + event = SynthesizeKeyEvent(window, true, ui::VKEY_MENU, flags); DCHECK(event); events->push_back(event); } if (command) { flags |= NSCommandKeyMask; - event = SynthesizeKeyEvent(window, true, app::VKEY_COMMAND, flags); + event = SynthesizeKeyEvent(window, true, ui::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, app::VKEY_COMMAND, flags); + event = SynthesizeKeyEvent(window, false, ui::VKEY_COMMAND, flags); DCHECK(event); events->push_back(event); } if (alt) { flags &= ~NSAlternateKeyMask; - event = SynthesizeKeyEvent(window, false, app::VKEY_MENU, flags); + event = SynthesizeKeyEvent(window, false, ui::VKEY_MENU, flags); DCHECK(event); events->push_back(event); } if (shift) { flags &= ~NSShiftKeyMask; - event = SynthesizeKeyEvent(window, false, app::VKEY_SHIFT, flags); + event = SynthesizeKeyEvent(window, false, ui::VKEY_SHIFT, flags); DCHECK(event); events->push_back(event); } if (control) { flags &= ~NSControlKeyMask; - event = SynthesizeKeyEvent(window, false, app::VKEY_CONTROL, flags); + event = SynthesizeKeyEvent(window, false, ui::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, - app::KeyboardCode key, + ui::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, - app::KeyboardCode key, + ui::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 b03c97b..127ea6d 100644 --- a/chrome/browser/automation/ui_controls_win.cc +++ b/chrome/browser/automation/ui_controls_win.cc @@ -4,12 +4,12 @@ #include "chrome/browser/automation/ui_controls.h" -#include "app/keyboard_code_conversion_win.h" -#include "app/keyboard_codes.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/ref_counted.h" #include "base/task.h" +#include "ui/base/keycodes/keyboard_codes.h" +#include "ui/base/keycodes/keyboard_code_conversion_win.h" #include "views/view.h" namespace ui_controls { @@ -139,10 +139,10 @@ void InputDispatcher::NotifyTask() { // Populate the INPUT structure with the appropriate keyboard event // parameters required by SendInput -bool FillKeyboardInput(app::KeyboardCode key, INPUT* input, bool key_up) { +bool FillKeyboardInput(ui::KeyboardCode key, INPUT* input, bool key_up) { memset(input, 0, sizeof(INPUT)); input->type = INPUT_KEYBOARD; - input->ki.wVk = app::WindowsKeyCodeForKeyboardCode(key); + input->ki.wVk = ui::WindowsKeyCodeForKeyboardCode(key); input->ki.dwFlags = key_up ? KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP : KEYEVENTF_EXTENDEDKEY; @@ -150,7 +150,7 @@ bool FillKeyboardInput(app::KeyboardCode key, INPUT* input, bool key_up) { } // Send a key event (up/down) -bool SendKeyEvent(app::KeyboardCode key, bool up) { +bool SendKeyEvent(ui::KeyboardCode key, bool up) { INPUT input = { 0 }; if (!FillKeyboardInput(key, &input, up)) @@ -162,7 +162,7 @@ bool SendKeyEvent(app::KeyboardCode key, bool up) { return true; } -bool SendKeyPressImpl(app::KeyboardCode key, +bool SendKeyPressImpl(ui::KeyboardCode key, bool control, bool shift, bool alt, Task* task) { scoped_refptr<InputDispatcher> dispatcher( @@ -173,7 +173,7 @@ bool SendKeyPressImpl(app::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 = app::WindowsKeyCodeForKeyboardCode(key); + WPARAM w_param = ui::WindowsKeyCodeForKeyboardCode(key); LPARAM l_param = 0; ::SendMessage(popup_menu, WM_KEYDOWN, w_param, l_param); ::SendMessage(popup_menu, WM_KEYUP, w_param, l_param); @@ -187,19 +187,19 @@ bool SendKeyPressImpl(app::KeyboardCode key, UINT i = 0; if (control) { - if (!FillKeyboardInput(app::VKEY_CONTROL, &input[i], false)) + if (!FillKeyboardInput(ui::VKEY_CONTROL, &input[i], false)) return false; i++; } if (shift) { - if (!FillKeyboardInput(app::VKEY_SHIFT, &input[i], false)) + if (!FillKeyboardInput(ui::VKEY_SHIFT, &input[i], false)) return false; i++; } if (alt) { - if (!FillKeyboardInput(app::VKEY_MENU, &input[i], false)) + if (!FillKeyboardInput(ui::VKEY_MENU, &input[i], false)) return false; i++; } @@ -213,19 +213,19 @@ bool SendKeyPressImpl(app::KeyboardCode key, i++; if (alt) { - if (!FillKeyboardInput(app::VKEY_MENU, &input[i], true)) + if (!FillKeyboardInput(ui::VKEY_MENU, &input[i], true)) return false; i++; } if (shift) { - if (!FillKeyboardInput(app::VKEY_SHIFT, &input[i], true)) + if (!FillKeyboardInput(ui::VKEY_SHIFT, &input[i], true)) return false; i++; } if (control) { - if (!FillKeyboardInput(app::VKEY_CONTROL, &input[i], true)) + if (!FillKeyboardInput(ui::VKEY_CONTROL, &input[i], true)) return false; i++; } @@ -325,14 +325,14 @@ bool SendMouseEventsImpl(MouseButton type, int state, Task* task) { // public functions ----------------------------------------------------------- -bool SendKeyPress(gfx::NativeWindow window, app::KeyboardCode key, +bool SendKeyPress(gfx::NativeWindow window, ui::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, - app::KeyboardCode key, + ui::KeyboardCode key, bool control, bool shift, bool alt, bool command, Task* task) { |