| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/button/text_button.h" | 5 #include "ui/views/controls/button/text_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 // TextButton ----------------------------------------------------------------- | 596 // TextButton ----------------------------------------------------------------- |
| 597 | 597 |
| 598 TextButton::TextButton(ButtonListener* listener, const base::string16& text) | 598 TextButton::TextButton(ButtonListener* listener, const base::string16& text) |
| 599 : TextButtonBase(listener, text), | 599 : TextButtonBase(listener, text), |
| 600 icon_placement_(ICON_ON_LEFT), | 600 icon_placement_(ICON_ON_LEFT), |
| 601 has_hover_icon_(false), | 601 has_hover_icon_(false), |
| 602 has_pushed_icon_(false), | 602 has_pushed_icon_(false), |
| 603 icon_text_spacing_(kDefaultIconTextSpacing), | 603 icon_text_spacing_(kDefaultIconTextSpacing), |
| 604 ignore_minimum_size_(true), | 604 ignore_minimum_size_(true), |
| 605 full_justification_(false) { | 605 full_justification_(false) { |
| 606 set_border(new TextButtonDefaultBorder); | 606 SetBorder(scoped_ptr<Border>(new TextButtonDefaultBorder)); |
| 607 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets( | 607 SetFocusPainter(Painter::CreateDashedFocusPainterWithInsets( |
| 608 gfx::Insets(kFocusRectInset, kFocusRectInset, | 608 gfx::Insets(kFocusRectInset, kFocusRectInset, |
| 609 kFocusRectInset, kFocusRectInset))); | 609 kFocusRectInset, kFocusRectInset))); |
| 610 } | 610 } |
| 611 | 611 |
| 612 TextButton::~TextButton() { | 612 TextButton::~TextButton() { |
| 613 } | 613 } |
| 614 | 614 |
| 615 void TextButton::SetIcon(const gfx::ImageSkia& icon) { | 615 void TextButton::SetIcon(const gfx::ImageSkia& icon) { |
| 616 icon_ = icon; | 616 icon_ = icon; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 if (show_multiple_icon_states_) { | 748 if (show_multiple_icon_states_) { |
| 749 if (has_hover_icon_ && (state() == STATE_HOVERED)) | 749 if (has_hover_icon_ && (state() == STATE_HOVERED)) |
| 750 return icon_hover_; | 750 return icon_hover_; |
| 751 if (has_pushed_icon_ && (state() == STATE_PRESSED)) | 751 if (has_pushed_icon_ && (state() == STATE_PRESSED)) |
| 752 return icon_pushed_; | 752 return icon_pushed_; |
| 753 } | 753 } |
| 754 return icon_; | 754 return icon_; |
| 755 } | 755 } |
| 756 | 756 |
| 757 } // namespace views | 757 } // namespace views |
| OLD | NEW |