summaryrefslogtreecommitdiffstats
path: root/views/controls/link.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-23 02:49:36 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-23 02:49:36 +0000
commit4407740fe48f3a373cd5fafe3a0b68dd4117686a (patch)
tree89c27804d87f984ffbfb0b0694f690c4205e10ff /views/controls/link.cc
parent232d1b83fbcadc744455b9b1615713d54f974499 (diff)
downloadchromium_src-4407740fe48f3a373cd5fafe3a0b68dd4117686a.zip
chromium_src-4407740fe48f3a373cd5fafe3a0b68dd4117686a.tar.gz
chromium_src-4407740fe48f3a373cd5fafe3a0b68dd4117686a.tar.bz2
Gets link to compile on linux.
BUG=none TEST=none Review URL: http://codereview.chromium.org/113797 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/link.cc')
-rw-r--r--views/controls/link.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/views/controls/link.cc b/views/controls/link.cc
index cd506bf..a9b8d7e 100644
--- a/views/controls/link.cc
+++ b/views/controls/link.cc
@@ -5,11 +5,14 @@
#include "views/controls/link.h"
#include "app/gfx/font.h"
+#include "base/logging.h"
#include "views/event.h"
namespace views {
+#if defined(OS_WIN)
static HCURSOR g_hand_cursor = NULL;
+#endif
// Default colors used for links.
static const SkColor kHighlightedColor = SkColorSetRGB(255, 0x00, 0x00);
@@ -103,7 +106,14 @@ void Link::OnMouseReleased(const MouseEvent& e, bool canceled) {
}
bool Link::OnKeyPressed(const KeyEvent& e) {
- if ((e.GetCharacter() == VK_SPACE) || (e.GetCharacter() == VK_RETURN)) {
+#if defined(OS_WIN)
+ bool activate = ((e.GetCharacter() == VK_SPACE) ||
+ (e.GetCharacter() == VK_RETURN));
+#else
+ bool activate = false;
+ NOTIMPLEMENTED();
+#endif
+ if (activate) {
SetHighlighted(false);
// Focus the link on key pressed.
@@ -118,8 +128,13 @@ bool Link::OnKeyPressed(const KeyEvent& e) {
}
bool Link::OverrideAccelerator(const Accelerator& accelerator) {
+#if defined(OS_WIN)
return (accelerator.GetKeyCode() == VK_SPACE) ||
(accelerator.GetKeyCode() == VK_RETURN);
+#else
+ NOTIMPLEMENTED();
+ return false;
+#endif
}
void Link::SetHighlighted(bool f) {
@@ -169,6 +184,7 @@ void Link::SetEnabled(bool f) {
}
}
+#if defined(OS_WIN)
HCURSOR Link::GetCursorForPoint(Event::EventType event_type, int x, int y) {
if (enabled_) {
if (!g_hand_cursor) {
@@ -179,5 +195,6 @@ HCURSOR Link::GetCursorForPoint(Event::EventType event_type, int x, int y) {
return NULL;
}
}
+#endif
} // namespace views