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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 #if defined(OS_WIN) | 789 #if defined(OS_WIN) |
790 // Windows will like to show its own colors. | 790 // Windows will like to show its own colors. |
791 // Halos and such are ignored as they are always set by specific calls. | 791 // Halos and such are ignored as they are always set by specific calls. |
792 color_enabled_ = skia::COLORREFToSkColor(GetSysColor(COLOR_BTNTEXT)); | 792 color_enabled_ = skia::COLORREFToSkColor(GetSysColor(COLOR_BTNTEXT)); |
793 color_disabled_ = skia::COLORREFToSkColor(GetSysColor(COLOR_GRAYTEXT)); | 793 color_disabled_ = skia::COLORREFToSkColor(GetSysColor(COLOR_GRAYTEXT)); |
794 color_hover_ = color_ = color_enabled_; | 794 color_hover_ = color_ = color_enabled_; |
795 #endif | 795 #endif |
796 set_border(new TextButtonNativeThemeBorder(this)); | 796 set_border(new TextButtonNativeThemeBorder(this)); |
797 set_ignore_minimum_size(false); | 797 set_ignore_minimum_size(false); |
798 set_alignment(ALIGN_CENTER); | 798 set_alignment(ALIGN_CENTER); |
| 799 set_focusable(true); |
799 } | 800 } |
800 | 801 |
801 gfx::Size NativeTextButton::GetMinimumSize() { | 802 gfx::Size NativeTextButton::GetMinimumSize() { |
802 return GetPreferredSize(); | 803 return GetPreferredSize(); |
803 } | 804 } |
804 | 805 |
805 std::string NativeTextButton::GetClassName() const { | 806 std::string NativeTextButton::GetClassName() const { |
806 return kViewClassName; | 807 return kViewClassName; |
807 } | 808 } |
808 | 809 |
809 } // namespace views | 810 } // namespace views |
OLD | NEW |