diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 21:18:58 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-28 21:18:58 +0000 |
commit | d766882c913b272cc2db478d7640a317d838ebad (patch) | |
tree | 99424c7a994d0d771bd4c3bdf2b196042b937b62 /chrome/browser/autocomplete/autocomplete_edit_view_win.cc | |
parent | eb75208190b35bedd144e102ea5cc826358bbbfd (diff) | |
download | chromium_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 'chrome/browser/autocomplete/autocomplete_edit_view_win.cc')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_win.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 1fc89f4..91ea6b1 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -17,6 +17,7 @@ #include "base/basictypes.h" #include "base/clipboard.h" #include "base/iat_patch.h" +#include "base/keyboard_codes.h" #include "base/lazy_instance.h" #include "base/ref_counted.h" #include "base/scoped_clipboard_writer.h" @@ -876,11 +877,11 @@ void AutocompleteEditViewWin::PasteAndGo(const std::wstring& text) { bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( const views::KeyEvent& e) { - int c = e.GetCharacter(); + base::KeyboardCode key = e.GetKeyCode(); // We don't process ALT + numpad digit as accelerators, 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; // Skip accelerators for key combinations omnibox wants to crack. This list @@ -890,30 +891,29 @@ bool AutocompleteEditViewWin::SkipDefaultKeyEventProcessing( // We cannot return true for all keys because we still need to handle some // accelerators (e.g., F5 for reload the page should work even when the // Omnibox gets focused). - switch (c) { - case VK_ESCAPE: { + switch (key) { + case base::VKEY_ESCAPE: { ScopedFreeze freeze(this, GetTextObjectModel()); return model_->OnEscapeKeyPressed(); } - case VK_RETURN: + case base::VKEY_RETURN: return true; - case VK_UP: - case VK_DOWN: + case base::VKEY_UP: + case base::VKEY_DOWN: return !e.IsAltDown(); - case VK_DELETE: - case VK_INSERT: + case base::VKEY_DELETE: + case base::VKEY_INSERT: return !e.IsAltDown() && e.IsShiftDown() && !e.IsControlDown(); - case 'X': - case 'V': + case base::VKEY_X: + case base::VKEY_V: return !e.IsAltDown() && e.IsControlDown(); - case VK_BACK: - case 0xbb: // We don't use VK_OEM_PLUS in case the macro isn't defined. - // (e.g., we don't have this symbol in embeded environment). + case base::VKEY_BACK: + case base::VKEY_OEM_PLUS: return true; default: |