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

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

Issue 8359029: ui/gfx: Convert Canvas::DrawFocusRect() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Peter's review Created 9 years, 2 months 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 | « views/controls/button/checkbox.cc ('k') | 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 "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 "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 return kViewClassName; 823 return kViewClassName;
824 } 824 }
825 825
826 void NativeTextButton::OnPaintFocusBorder(gfx::Canvas* canvas) { 826 void NativeTextButton::OnPaintFocusBorder(gfx::Canvas* canvas) {
827 #if defined(OS_WIN) 827 #if defined(OS_WIN)
828 // On windows, make sure the focus border is inset wrt the entire button so 828 // On windows, make sure the focus border is inset wrt the entire button so
829 // that the native text button appears more like a windows button. 829 // that the native text button appears more like a windows button.
830 if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) { 830 if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
831 gfx::Rect rect(GetLocalBounds()); 831 gfx::Rect rect(GetLocalBounds());
832 rect.Inset(3, 3); 832 rect.Inset(3, 3);
833 canvas->DrawFocusRect(rect.x(), rect.y(), rect.width(), rect.height()); 833 canvas->DrawFocusRect(rect);
834 } 834 }
835 #else 835 #else
836 TextButton::OnPaintFocusBorder(canvas); 836 TextButton::OnPaintFocusBorder(canvas);
837 #endif 837 #endif
838 } 838 }
839 839
840 void NativeTextButton::GetExtraParams( 840 void NativeTextButton::GetExtraParams(
841 gfx::NativeTheme::ExtraParams* params) const { 841 gfx::NativeTheme::ExtraParams* params) const {
842 TextButton::GetExtraParams(params); 842 TextButton::GetExtraParams(params);
843 params->button.has_border = true; 843 params->button.has_border = true;
844 } 844 }
845 845
846 } // namespace views 846 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/checkbox.cc ('k') | views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698