Index: chrome/views/controls/button/native_button.cc |
=================================================================== |
--- chrome/views/controls/button/native_button.cc (revision 15583) |
+++ chrome/views/controls/button/native_button.cc (working copy) |
@@ -4,6 +4,10 @@ |
#include "chrome/views/controls/button/native_button.h" |
+#if defined(OS_LINUX) |
+#include <gdk/gdkkeysyms.h> |
+#endif |
+ |
#include "app/l10n_util.h" |
#include "base/logging.h" |
@@ -69,10 +73,15 @@ |
void NativeButton::SetIsDefault(bool is_default) { |
if (is_default == is_default_) |
return; |
+#if defined(OS_WIN) |
+ int return_code = VK_RETURN; |
+#else |
+ int return_code = GDK_Return; |
+#endif |
if (is_default) |
- AddAccelerator(Accelerator(VK_RETURN, false, false, false)); |
+ AddAccelerator(Accelerator(return_code, false, false, false)); |
else |
- RemoveAccelerator(Accelerator(VK_RETURN, false, false, false)); |
+ RemoveAccelerator(Accelerator(return_code, false, false, false)); |
SetAppearsAsDefault(is_default); |
} |
@@ -106,6 +115,7 @@ |
// Clamp the size returned to at least the minimum size. |
if (!ignore_minimum_size_) { |
+#if defined(OS_WIN) |
if (minimum_size_.width()) { |
int min_width = font_.horizontal_dlus_to_pixels(minimum_size_.width()); |
sz.set_width(std::max(static_cast<int>(sz.width()), min_width)); |
@@ -114,6 +124,10 @@ |
int min_height = font_.vertical_dlus_to_pixels(minimum_size_.height()); |
sz.set_height(std::max(static_cast<int>(sz.height()), min_height)); |
} |
+#else |
+ if (minimum_size_.width() || minimum_size_.height()) |
+ NOTIMPLEMENTED(); |
+#endif |
} |
return sz; |