| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "ui/base/keycodes/keyboard_codes.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 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 #if defined(TOUCH_UI) | 243 #if defined(TOUCH_UI) |
| 244 //////////////////////////////////////////////////////////////////////////////// | 244 //////////////////////////////////////////////////////////////////////////////// |
| 245 // NativeButton, public: | 245 // NativeButton, public: |
| 246 | 246 |
| 247 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label) | 247 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label) |
| 248 : TextButton(listener, label), is_default_(false) { | 248 : TextButton(listener, label), is_default_(false) { |
| 249 set_alignment(TextButton::ALIGN_CENTER); | 249 set_alignment(TextButton::ALIGN_CENTER); |
| 250 static_cast<TextButtonBorder*>(border())->copy_normal_set_to_hot_set(); | 250 static_cast<TextButtonBorder*>(border())->copy_normal_set_to_hot_set(); |
| 251 set_animate_on_state_change(false); |
| 251 set_focusable(true); | 252 set_focusable(true); |
| 252 } | 253 } |
| 253 | 254 |
| 254 void NativeButton::SetLabel(const std::wstring& label) { | 255 void NativeButton::SetLabel(const std::wstring& label) { |
| 255 SetText(label); | 256 SetText(label); |
| 256 } | 257 } |
| 257 | 258 |
| 258 void NativeButton::set_font(const gfx::Font& font) { | 259 void NativeButton::set_font(const gfx::Font& font) { |
| 259 SetFont(font); | 260 SetFont(font); |
| 260 } | 261 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 280 | 281 |
| 281 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label) | 282 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label) |
| 282 : NativeButtonBase(listener, label) { | 283 : NativeButtonBase(listener, label) { |
| 283 } | 284 } |
| 284 | 285 |
| 285 NativeButton::~NativeButton() { | 286 NativeButton::~NativeButton() { |
| 286 } | 287 } |
| 287 #endif | 288 #endif |
| 288 | 289 |
| 289 } // namespace views | 290 } // namespace views |
| OLD | NEW |