Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: ui/views/controls/button/text_button.cc

Issue 8964001: views: Convert IsFocusable() to just focusable() since it's just a simple accessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: don't need to override IsFocusableInRootView in omnibox_view_views Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 746
747 void TextButton::set_ignore_minimum_size(bool ignore_minimum_size) { 747 void TextButton::set_ignore_minimum_size(bool ignore_minimum_size) {
748 ignore_minimum_size_ = ignore_minimum_size; 748 ignore_minimum_size_ = ignore_minimum_size;
749 } 749 }
750 750
751 std::string TextButton::GetClassName() const { 751 std::string TextButton::GetClassName() const {
752 return kViewClassName; 752 return kViewClassName;
753 } 753 }
754 754
755 void TextButton::OnPaintFocusBorder(gfx::Canvas* canvas) { 755 void TextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
756 if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) { 756 if ((focusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
757 gfx::Rect rect(GetLocalBounds()); 757 gfx::Rect rect(GetLocalBounds());
758 rect.Inset(kFocusRectInset, kFocusRectInset); 758 rect.Inset(kFocusRectInset, kFocusRectInset);
759 canvas->DrawFocusRect(rect); 759 canvas->DrawFocusRect(rect);
760 } 760 }
761 } 761 }
762 762
763 gfx::NativeTheme::Part TextButton::GetThemePart() const { 763 gfx::NativeTheme::Part TextButton::GetThemePart() const {
764 return gfx::NativeTheme::kPushButton; 764 return gfx::NativeTheme::kPushButton;
765 } 765 }
766 766
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 gfx::Size NativeTextButton::GetMinimumSize() { 834 gfx::Size NativeTextButton::GetMinimumSize() {
835 return GetPreferredSize(); 835 return GetPreferredSize();
836 } 836 }
837 837
838 std::string NativeTextButton::GetClassName() const { 838 std::string NativeTextButton::GetClassName() const {
839 return kViewClassName; 839 return kViewClassName;
840 } 840 }
841 841
842 void NativeTextButton::OnPaintFocusBorder(gfx::Canvas* canvas) { 842 void NativeTextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
843 #if defined(OS_WIN) 843 #if defined(OS_WIN)
844 if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) { 844 if ((focusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
845 gfx::Rect rect(GetLocalBounds()); 845 gfx::Rect rect(GetLocalBounds());
846 rect.Inset(kFocusRectInset, kFocusRectInset); 846 rect.Inset(kFocusRectInset, kFocusRectInset);
847 canvas->DrawFocusRect(rect); 847 canvas->DrawFocusRect(rect);
848 } 848 }
849 #else 849 #else
850 TextButton::OnPaintFocusBorder(canvas); 850 TextButton::OnPaintFocusBorder(canvas);
851 #endif 851 #endif
852 } 852 }
853 853
854 void NativeTextButton::GetExtraParams( 854 void NativeTextButton::GetExtraParams(
855 gfx::NativeTheme::ExtraParams* params) const { 855 gfx::NativeTheme::ExtraParams* params) const {
856 TextButton::GetExtraParams(params); 856 TextButton::GetExtraParams(params);
857 params->button.has_border = true; 857 params->button.has_border = true;
858 } 858 }
859 859
860 } // namespace views 860 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698