diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 00:33:35 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-29 00:33:35 +0000 |
commit | bc1407f95bae3d7472ee0c85ef83ee10610b3f1f (patch) | |
tree | eeb1e01423fefc13afe5738d809df200b5e50623 /chrome/test/automation | |
parent | 62525634a6f5727216828f8e05a4f563be90dfeb (diff) | |
download | chromium_src-bc1407f95bae3d7472ee0c85ef83ee10610b3f1f.zip chromium_src-bc1407f95bae3d7472ee0c85ef83ee10610b3f1f.tar.gz chromium_src-bc1407f95bae3d7472ee0c85ef83ee10610b3f1f.tar.bz2 |
Relanding keyboard code refactoring:
http://codereview.chromium.org/248010/show
Changing the KeyboardEvent to use a KeyboardCode instead of a w_char. Led to several places where I had to switch from VK_ to VKEY_.
Also cleaned-up the table view OnKeyDown method. Since TableView is a NativeControl it can use the NativeControl::OnKeyDown directly.
BUG=None
TEST=Make sure short-cuts works as expected, especially in the omnibox.
Review URL: http://codereview.chromium.org/251020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 4 | ||||
-rw-r--r-- | chrome/test/automation/window_proxy.cc | 2 | ||||
-rw-r--r-- | chrome/test/automation/window_proxy.h | 11 |
3 files changed, 9 insertions, 8 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index e7016cf..89f90ff 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -415,10 +415,10 @@ IPC_BEGIN_MESSAGES(Automation) // This message requests that a key press be performed. // Request: // int - the handle of the window that's the context for this click - // wchar_t - char of the key that was pressed. + // int - the base::KeyboardCode of the key that was pressed. // int - the flags which identify the modifiers (shift, ctrl, alt) // associated for, as defined in chrome/views/event.h - IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, wchar_t, int) + IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, int, int) // This message notifies the AutomationProvider to create a tab which is // hosted by an external process. diff --git a/chrome/test/automation/window_proxy.cc b/chrome/test/automation/window_proxy.cc index 5766259..5b08842 100644 --- a/chrome/test/automation/window_proxy.cc +++ b/chrome/test/automation/window_proxy.cc @@ -34,7 +34,7 @@ bool WindowProxy::GetWindowTitle(string16* text) { return sender_->Send(new AutomationMsg_WindowTitle(0, handle_, text)); } -bool WindowProxy::SimulateOSKeyPress(wchar_t key, int flags) { +bool WindowProxy::SimulateOSKeyPress(base::KeyboardCode key, int flags) { if (!is_valid()) return false; return sender_->Send( diff --git a/chrome/test/automation/window_proxy.h b/chrome/test/automation/window_proxy.h index 539ac20..33a27c0 100644 --- a/chrome/test/automation/window_proxy.h +++ b/chrome/test/automation/window_proxy.h @@ -13,6 +13,7 @@ #include <string> +#include "base/keyboard_codes.h" #include "base/string16.h" #include "base/thread.h" #include "chrome/test/automation/automation_handle_tracker.h" @@ -46,11 +47,11 @@ class WindowProxy : public AutomationResourceProxy { // Get the title of the top level window. bool GetWindowTitle(string16* text); - // Simulates a key press at the OS level. |key| is the key pressed and - // |flags| specifies which modifiers keys are also pressed (as defined in - // chrome/views/event.h). Note that this actually sends the event to the - // window that has focus. - bool SimulateOSKeyPress(wchar_t key, int flags); + // Simulates a key press at the OS level. |key| is the virtual key code of the + // key pressed and |flags| specifies which modifiers keys are also pressed (as + // defined in chrome/views/event.h). Note that this actually sends the event + // to the window that has focus. + bool SimulateOSKeyPress(base::KeyboardCode key, int flags); // Shows/hides the window and as a result makes it active/inactive. // Returns true if the call was successful. |