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 /views/controls/scrollbar | |
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 'views/controls/scrollbar')
-rw-r--r-- | views/controls/scrollbar/bitmap_scroll_bar.cc | 19 | ||||
-rw-r--r-- | views/controls/scrollbar/native_scroll_bar_win.cc | 19 |
2 files changed, 20 insertions, 18 deletions
diff --git a/views/controls/scrollbar/bitmap_scroll_bar.cc b/views/controls/scrollbar/bitmap_scroll_bar.cc index b04e0b0..98a95ff 100644 --- a/views/controls/scrollbar/bitmap_scroll_bar.cc +++ b/views/controls/scrollbar/bitmap_scroll_bar.cc @@ -11,6 +11,7 @@ #include "app/gfx/canvas.h" #include "app/l10n_util.h" #include "base/compiler_specific.h" +#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "grit/app_strings.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -494,33 +495,33 @@ bool BitmapScrollBar::OnMouseWheel(const MouseWheelEvent& event) { bool BitmapScrollBar::OnKeyPressed(const KeyEvent& event) { ScrollAmount amount = SCROLL_NONE; - switch (event.GetCharacter()) { - case VK_UP: + switch (event.GetKeyCode()) { + case base::VKEY_UP: if (!IsHorizontal()) amount = SCROLL_PREV_LINE; break; - case VK_DOWN: + case base::VKEY_DOWN: if (!IsHorizontal()) amount = SCROLL_NEXT_LINE; break; - case VK_LEFT: + case base::VKEY_LEFT: if (IsHorizontal()) amount = SCROLL_PREV_LINE; break; - case VK_RIGHT: + case base::VKEY_RIGHT: if (IsHorizontal()) amount = SCROLL_NEXT_LINE; break; - case VK_PRIOR: + case base::VKEY_PRIOR: amount = SCROLL_PREV_PAGE; break; - case VK_NEXT: + case base::VKEY_NEXT: amount = SCROLL_NEXT_PAGE; break; - case VK_HOME: + case base::VKEY_HOME: amount = SCROLL_START; break; - case VK_END: + case base::VKEY_END: amount = SCROLL_END; break; } diff --git a/views/controls/scrollbar/native_scroll_bar_win.cc b/views/controls/scrollbar/native_scroll_bar_win.cc index b15be33..00b3b8c 100644 --- a/views/controls/scrollbar/native_scroll_bar_win.cc +++ b/views/controls/scrollbar/native_scroll_bar_win.cc @@ -7,6 +7,7 @@ #include <algorithm> #include <string> +#include "base/keyboard_codes.h" #include "base/message_loop.h" #include "base/window_impl.h" #include "views/controls/scrollbar/native_scroll_bar.h" @@ -229,32 +230,32 @@ bool NativeScrollBarWin::OnKeyPressed(const KeyEvent& event) { if (!sb_container_) return false; int code = -1; - switch (event.GetCharacter()) { - case VK_UP: + switch (event.GetKeyCode()) { + case base::VKEY_UP: if (!native_scroll_bar_->IsHorizontal()) code = SB_LINEUP; break; - case VK_PRIOR: + case base::VKEY_PRIOR: code = SB_PAGEUP; break; - case VK_NEXT: + case base::VKEY_NEXT: code = SB_PAGEDOWN; break; - case VK_DOWN: + case base::VKEY_DOWN: if (!native_scroll_bar_->IsHorizontal()) code = SB_LINEDOWN; break; - case VK_HOME: + case base::VKEY_HOME: code = SB_TOP; break; - case VK_END: + case base::VKEY_END: code = SB_BOTTOM; break; - case VK_LEFT: + case base::VKEY_LEFT: if (native_scroll_bar_->IsHorizontal()) code = SB_LINELEFT; break; - case VK_RIGHT: + case base::VKEY_RIGHT: if (native_scroll_bar_->IsHorizontal()) code = SB_LINERIGHT; break; |