| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/button/native_button.h" | 5 #include "views/controls/button/native_button.h" |
| 6 | 6 |
| 7 #include "app/keyboard_codes.h" | |
| 8 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "ui/base/keycodes/keyboard_codes.h" |
| 9 #include "views/controls/native/native_view_host.h" | 9 #include "views/controls/native/native_view_host.h" |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include "gfx/platform_font_win.h" | 12 #include "gfx/platform_font_win.h" |
| 13 #elif defined(OS_LINUX) | 13 #elif defined(OS_LINUX) |
| 14 #include <gdk/gdkkeysyms.h> | 14 #include <gdk/gdkkeysyms.h> |
| 15 #include "views/screen.h" | 15 #include "views/screen.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 | 18 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 // Update the accessible name whenever the label changes. | 82 // Update the accessible name whenever the label changes. |
| 83 SetAccessibleName(label); | 83 SetAccessibleName(label); |
| 84 PreferredSizeChanged(); | 84 PreferredSizeChanged(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void NativeButton::SetIsDefault(bool is_default) { | 87 void NativeButton::SetIsDefault(bool is_default) { |
| 88 if (is_default == is_default_) | 88 if (is_default == is_default_) |
| 89 return; | 89 return; |
| 90 if (is_default) | 90 if (is_default) |
| 91 AddAccelerator(Accelerator(app::VKEY_RETURN, false, false, false)); | 91 AddAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); |
| 92 else | 92 else |
| 93 RemoveAccelerator(Accelerator(app::VKEY_RETURN, false, false, false)); | 93 RemoveAccelerator(Accelerator(ui::VKEY_RETURN, false, false, false)); |
| 94 SetAppearsAsDefault(is_default); | 94 SetAppearsAsDefault(is_default); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void NativeButton::SetNeedElevation(bool need_elevation) { | 97 void NativeButton::SetNeedElevation(bool need_elevation) { |
| 98 need_elevation_ = need_elevation; | 98 need_elevation_ = need_elevation; |
| 99 if (native_wrapper_) | 99 if (native_wrapper_) |
| 100 native_wrapper_->UpdateLabel(); | 100 native_wrapper_->UpdateLabel(); |
| 101 PreferredSizeChanged(); | 101 PreferredSizeChanged(); |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 native_wrapper->UpdateEnabled(); | 229 native_wrapper->UpdateEnabled(); |
| 230 return native_wrapper; | 230 return native_wrapper; |
| 231 } | 231 } |
| 232 | 232 |
| 233 void NativeButton::InitBorder() { | 233 void NativeButton::InitBorder() { |
| 234 set_border(Border::CreateEmptyBorder(0, kButtonBorderHWidth, 0, | 234 set_border(Border::CreateEmptyBorder(0, kButtonBorderHWidth, 0, |
| 235 kButtonBorderHWidth)); | 235 kButtonBorderHWidth)); |
| 236 } | 236 } |
| 237 | 237 |
| 238 } // namespace views | 238 } // namespace views |
| OLD | NEW |