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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 gfx::Size TextButtonBorder::GetMinimumSize() const { | 83 gfx::Size TextButtonBorder::GetMinimumSize() const { |
84 return gfx::Size(); | 84 return gfx::Size(); |
85 } | 85 } |
86 | 86 |
87 void TextButtonBorder::SetInsets(const gfx::Insets& insets) { | 87 void TextButtonBorder::SetInsets(const gfx::Insets& insets) { |
88 insets_ = insets; | 88 insets_ = insets; |
89 } | 89 } |
90 | 90 |
91 TextButtonBorder* TextButtonBorder::AsTextButtonBorder() { | |
92 return this; | |
93 } | |
94 | |
95 const TextButtonBorder* TextButtonBorder::AsTextButtonBorder() const { | |
96 return this; | |
97 } | |
98 | |
99 | 91 |
100 // TextButtonDefaultBorder ---------------------------------------------------- | 92 // TextButtonDefaultBorder ---------------------------------------------------- |
101 | 93 |
102 TextButtonDefaultBorder::TextButtonDefaultBorder() | 94 TextButtonDefaultBorder::TextButtonDefaultBorder() |
103 : vertical_padding_(kPreferredPaddingVertical) { | 95 : vertical_padding_(kPreferredPaddingVertical) { |
104 set_hot_painter(Painter::CreateImageGridPainter(kHotImages)); | 96 set_hot_painter(Painter::CreateImageGridPainter(kHotImages)); |
105 set_pushed_painter(Painter::CreateImageGridPainter(kPushedImages)); | 97 set_pushed_painter(Painter::CreateImageGridPainter(kPushedImages)); |
106 SetInsets(gfx::Insets(vertical_padding_, kPreferredPaddingHorizontal, | 98 SetInsets(gfx::Insets(vertical_padding_, kPreferredPaddingHorizontal, |
107 vertical_padding_, kPreferredPaddingHorizontal)); | 99 vertical_padding_, kPreferredPaddingHorizontal)); |
108 } | 100 } |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 if (show_multiple_icon_states_) { | 740 if (show_multiple_icon_states_) { |
749 if (has_hover_icon_ && (state() == STATE_HOVERED)) | 741 if (has_hover_icon_ && (state() == STATE_HOVERED)) |
750 return icon_hover_; | 742 return icon_hover_; |
751 if (has_pushed_icon_ && (state() == STATE_PRESSED)) | 743 if (has_pushed_icon_ && (state() == STATE_PRESSED)) |
752 return icon_pushed_; | 744 return icon_pushed_; |
753 } | 745 } |
754 return icon_; | 746 return icon_; |
755 } | 747 } |
756 | 748 |
757 } // namespace views | 749 } // namespace views |
OLD | NEW |