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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 | 769 |
770 gfx::Size NativeTextButton::GetMinimumSize() { | 770 gfx::Size NativeTextButton::GetMinimumSize() { |
771 return GetPreferredSize(); | 771 return GetPreferredSize(); |
772 } | 772 } |
773 | 773 |
774 std::string NativeTextButton::GetClassName() const { | 774 std::string NativeTextButton::GetClassName() const { |
775 return kViewClassName; | 775 return kViewClassName; |
776 } | 776 } |
777 | 777 |
778 void NativeTextButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 778 void NativeTextButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| 779 TextButtonBase::OnNativeThemeChanged(theme); |
779 SetThemeSpecificState(theme); | 780 SetThemeSpecificState(theme); |
780 } | 781 } |
781 | 782 |
782 void NativeTextButton::SetThemeSpecificState(const ui::NativeTheme* theme) { | 783 void NativeTextButton::SetThemeSpecificState(const ui::NativeTheme* theme) { |
783 #if defined(OS_WIN) | 784 #if defined(OS_WIN) |
784 if (theme == ui::NativeThemeWin::instance()) { | 785 if (theme == ui::NativeThemeWin::instance()) { |
785 if (use_enabled_color_from_theme()) | 786 if (use_enabled_color_from_theme()) |
786 set_color_enabled(skia::COLORREFToSkColor(GetSysColor(COLOR_BTNTEXT))); | 787 set_color_enabled(skia::COLORREFToSkColor(GetSysColor(COLOR_BTNTEXT))); |
787 if (use_disabled_color_from_theme()) | 788 if (use_disabled_color_from_theme()) |
788 set_color_disabled(skia::COLORREFToSkColor(GetSysColor(COLOR_GRAYTEXT))); | 789 set_color_disabled(skia::COLORREFToSkColor(GetSysColor(COLOR_GRAYTEXT))); |
(...skipping 22 matching lines...) Expand all Loading... |
811 // when not using NativeThemeWin. | 812 // when not using NativeThemeWin. |
812 #if defined(OS_WIN) | 813 #if defined(OS_WIN) |
813 if (GetNativeTheme() == ui::NativeThemeWin::instance()) | 814 if (GetNativeTheme() == ui::NativeThemeWin::instance()) |
814 return; | 815 return; |
815 #endif | 816 #endif |
816 params->button.is_focused = HasFocus() && | 817 params->button.is_focused = HasFocus() && |
817 (focusable() || IsAccessibilityFocusable()); | 818 (focusable() || IsAccessibilityFocusable()); |
818 } | 819 } |
819 | 820 |
820 } // namespace views | 821 } // namespace views |
OLD | NEW |