Chromium Code Reviews| 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/text_button.h" | 5 #include "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 "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 | 555 |
| 556 //////////////////////////////////////////////////////////////////////////////// | 556 //////////////////////////////////////////////////////////////////////////////// |
| 557 // TextButtonBase, View overrides: | 557 // TextButtonBase, View overrides: |
| 558 | 558 |
| 559 gfx::Size TextButtonBase::GetMinimumSize() { | 559 gfx::Size TextButtonBase::GetMinimumSize() { |
| 560 return max_text_size_; | 560 return max_text_size_; |
| 561 } | 561 } |
| 562 | 562 |
| 563 void TextButtonBase::SetEnabled(bool enabled) { | 563 void TextButtonBase::OnEnabledChanged(bool enabled) { |
| 564 if (enabled != IsEnabled()) { | 564 if (enabled != IsEnabled()) { |
| 565 CustomButton::SetEnabled(enabled); | 565 CustomButton::SetEnabled(enabled); |
|
Ben Goodger (Google)
2011/05/27 16:01:21
Infinite recursion.
tfarina
2011/05/27 16:25:04
Done.
| |
| 566 } | 566 } |
| 567 // We should always call UpdateColor() since the state of the button might be | 567 // We should always call UpdateColor() since the state of the button might be |
| 568 // changed by other functions like CustomButton::SetState(). | 568 // changed by other functions like CustomButton::SetState(). |
| 569 UpdateColor(); | 569 UpdateColor(); |
| 570 SchedulePaint(); | 570 SchedulePaint(); |
| 571 } | 571 } |
| 572 | 572 |
| 573 std::string TextButtonBase::GetClassName() const { | 573 std::string TextButtonBase::GetClassName() const { |
| 574 return kViewClassName; | 574 return kViewClassName; |
| 575 } | 575 } |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 736 bounds.Inset(0, 0, extra_width, 0); | 736 bounds.Inset(0, 0, extra_width, 0); |
| 737 } | 737 } |
| 738 } | 738 } |
| 739 | 739 |
| 740 return bounds; | 740 return bounds; |
| 741 } | 741 } |
| 742 | 742 |
| 743 } // namespace views | 743 } // namespace views |
| 744 | 744 |
| 745 | 745 |
| OLD | NEW |