summaryrefslogtreecommitdiffstats
path: root/views/controls/link.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 00:33:35 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-29 00:33:35 +0000
commitbc1407f95bae3d7472ee0c85ef83ee10610b3f1f (patch)
treeeeb1e01423fefc13afe5738d809df200b5e50623 /views/controls/link.cc
parent62525634a6f5727216828f8e05a4f563be90dfeb (diff)
downloadchromium_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 'views/controls/link.cc')
-rw-r--r--views/controls/link.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/views/controls/link.cc b/views/controls/link.cc
index f2887e0..6619568 100644
--- a/views/controls/link.cc
+++ b/views/controls/link.cc
@@ -10,6 +10,7 @@
#include "app/gfx/color_utils.h"
#include "app/gfx/font.h"
+#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "views/event.h"
@@ -123,8 +124,8 @@ void Link::OnMouseReleased(const MouseEvent& e, bool canceled) {
bool Link::OnKeyPressed(const KeyEvent& e) {
#if defined(OS_WIN)
- bool activate = ((e.GetCharacter() == VK_SPACE) ||
- (e.GetCharacter() == VK_RETURN));
+ bool activate = ((e.GetKeyCode() == base::VKEY_SPACE) ||
+ (e.GetKeyCode() == base::VKEY_RETURN));
#else
bool activate = false;
NOTIMPLEMENTED();
@@ -146,7 +147,8 @@ bool Link::OnKeyPressed(const KeyEvent& e) {
bool Link::SkipDefaultKeyEventProcessing(const KeyEvent& e) {
#if defined(OS_WIN)
// Make sure we don't process space or enter as accelerators.
- return (e.GetCharacter() == VK_SPACE) || (e.GetCharacter() == VK_RETURN);
+ return (e.GetKeyCode() == base::VKEY_SPACE) ||
+ (e.GetKeyCode() == base::VKEY_RETURN);
#else
NOTIMPLEMENTED();
return false;