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

Side by Side Diff: ui/views/controls/link.cc

Issue 124553006: Nukes Link::OnPaint, it's not needed and causes double focus border (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « ui/views/controls/link.h ('k') | no next file » | 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) 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/link.h" 5 #include "ui/views/controls/link.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 void Link::GetAccessibleState(ui::AccessibleViewState* state) { 141 void Link::GetAccessibleState(ui::AccessibleViewState* state) {
142 Label::GetAccessibleState(state); 142 Label::GetAccessibleState(state);
143 state->role = ui::AccessibilityTypes::ROLE_LINK; 143 state->role = ui::AccessibilityTypes::ROLE_LINK;
144 } 144 }
145 145
146 void Link::OnEnabledChanged() { 146 void Link::OnEnabledChanged() {
147 RecalculateFont(); 147 RecalculateFont();
148 View::OnEnabledChanged(); 148 View::OnEnabledChanged();
149 } 149 }
150 150
151 void Link::OnPaint(gfx::Canvas* canvas) {
152 Label::OnPaint(canvas);
153
154 if (HasFocus())
155 canvas->DrawFocusRect(GetLocalBounds());
156 }
157
158 void Link::OnFocus() { 151 void Link::OnFocus() {
159 Label::OnFocus(); 152 Label::OnFocus();
160 // We render differently focused. 153 // We render differently focused.
161 SchedulePaint(); 154 SchedulePaint();
162 } 155 }
163 156
164 void Link::OnBlur() { 157 void Link::OnBlur() {
165 Label::OnBlur(); 158 Label::OnBlur();
166 // We render differently focused. 159 // We render differently focused.
167 SchedulePaint(); 160 SchedulePaint();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 const int style = font_list().GetFontStyle(); 229 const int style = font_list().GetFontStyle();
237 const int intended_style = (enabled() && underline_) ? 230 const int intended_style = (enabled() && underline_) ?
238 (style | gfx::Font::UNDERLINE) : (style & ~gfx::Font::UNDERLINE); 231 (style | gfx::Font::UNDERLINE) : (style & ~gfx::Font::UNDERLINE);
239 if (style != intended_style) { 232 if (style != intended_style) {
240 Label::SetFontList( 233 Label::SetFontList(
241 font_list().DeriveFontListWithSizeDeltaAndStyle(0, intended_style)); 234 font_list().DeriveFontListWithSizeDeltaAndStyle(0, intended_style));
242 } 235 }
243 } 236 }
244 237
245 } // namespace views 238 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/link.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698