summaryrefslogtreecommitdiffstats
path: root/views/controls/textfield
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 21:18:58 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 21:18:58 +0000
commitd766882c913b272cc2db478d7640a317d838ebad (patch)
tree99424c7a994d0d771bd4c3bdf2b196042b937b62 /views/controls/textfield
parenteb75208190b35bedd144e102ea5cc826358bbbfd (diff)
downloadchromium_src-d766882c913b272cc2db478d7640a317d838ebad.zip
chromium_src-d766882c913b272cc2db478d7640a317d838ebad.tar.gz
chromium_src-d766882c913b272cc2db478d7640a317d838ebad.tar.bz2
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/248010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27412 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/textfield')
-rw-r--r--views/controls/textfield/native_textfield_win.cc7
-rw-r--r--views/controls/textfield/textfield.cc9
2 files changed, 9 insertions, 7 deletions
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index 1872492..d027156 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -9,6 +9,7 @@
#include "app/win_util.h"
#include "base/clipboard.h"
#include "base/gfx/native_theme.h"
+#include "base/keyboard_codes.h"
#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "base/win_util.h"
@@ -252,13 +253,13 @@ bool NativeTextfieldWin::GetAcceleratorForCommandId(int command_id,
// anywhere so we need to check for them explicitly here.
switch (command_id) {
case IDS_APP_CUT:
- *accelerator = views::Accelerator(L'X', false, true, false);
+ *accelerator = views::Accelerator(base::VKEY_X, false, true, false);
return true;
case IDS_APP_COPY:
- *accelerator = views::Accelerator(L'C', false, true, false);
+ *accelerator = views::Accelerator(base::VKEY_C, false, true, false);
return true;
case IDS_APP_PASTE:
- *accelerator = views::Accelerator(L'V', false, true, false);
+ *accelerator = views::Accelerator(base::VKEY_V, false, true, false);
return true;
}
return container_view_->GetWidget()->GetAccelerator(command_id, accelerator);
diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc
index 368e7fd..bf12e42 100644
--- a/views/controls/textfield/textfield.cc
+++ b/views/controls/textfield/textfield.cc
@@ -14,6 +14,7 @@
#include "base/win_util.h"
#endif
+#include "base/keyboard_codes.h"
#include "base/string_util.h"
#include "views/controls/textfield/native_textfield_wrapper.h"
#include "views/widget/widget.h"
@@ -221,14 +222,14 @@ bool Textfield::SkipDefaultKeyEventProcessing(const KeyEvent& e) {
#if defined(OS_WIN)
// TODO(hamaji): Figure out which keyboard combinations we need to add here,
// similar to LocationBarView::SkipDefaultKeyEventProcessing.
- const int c = e.GetCharacter();
- if (c == VK_BACK)
+ base::KeyboardCode key = e.GetKeyCode();
+ if (key == base::VKEY_BACK)
return true; // We'll handle BackSpace ourselves.
// We don't translate accelerators for ALT + NumPad digit, they are used for
// entering special characters. We do translate alt-home.
- if (e.IsAltDown() && (c != VK_HOME) &&
- win_util::IsNumPadDigit(c, e.IsExtendedKey()))
+ if (e.IsAltDown() && (key != base::VKEY_HOME) &&
+ win_util::IsNumPadDigit(key, e.IsExtendedKey()))
return true;
#endif
return false;