| 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/text_button.h" | 5 #include "views/controls/button/text_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 SetText(text); | 204 SetText(text); |
| 205 set_border(new TextButtonBorder); | 205 set_border(new TextButtonBorder); |
| 206 SetAnimationDuration(kHoverAnimationDurationMs); | 206 SetAnimationDuration(kHoverAnimationDurationMs); |
| 207 } | 207 } |
| 208 | 208 |
| 209 TextButton::~TextButton() { | 209 TextButton::~TextButton() { |
| 210 } | 210 } |
| 211 | 211 |
| 212 void TextButton::SetText(const std::wstring& text) { | 212 void TextButton::SetText(const std::wstring& text) { |
| 213 text_ = WideToUTF16Hack(text); | 213 text_ = WideToUTF16Hack(text); |
| 214 SetAccessibleName(text); | 214 SetAccessibleName(WideToUTF16Hack(text)); |
| 215 UpdateTextSize(); | 215 UpdateTextSize(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void TextButton::SetIcon(const SkBitmap& icon) { | 218 void TextButton::SetIcon(const SkBitmap& icon) { |
| 219 icon_ = icon; | 219 icon_ = icon; |
| 220 } | 220 } |
| 221 | 221 |
| 222 void TextButton::SetHoverIcon(const SkBitmap& icon) { | 222 void TextButton::SetHoverIcon(const SkBitmap& icon) { |
| 223 icon_hover_ = icon; | 223 icon_hover_ = icon; |
| 224 has_hover_icon_ = true; | 224 has_hover_icon_ = true; |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 | 455 |
| 456 std::string TextButton::GetClassName() const { | 456 std::string TextButton::GetClassName() const { |
| 457 return kViewClassName; | 457 return kViewClassName; |
| 458 } | 458 } |
| 459 | 459 |
| 460 void TextButton::Paint(gfx::Canvas* canvas) { | 460 void TextButton::Paint(gfx::Canvas* canvas) { |
| 461 Paint(canvas, false); | 461 Paint(canvas, false); |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace views | 464 } // namespace views |
| OLD | NEW |