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

Unified Diff: ui/views/controls/label.h

Issue 1018463004: Fix focus rectangle for label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/label.h
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h
index 4ecbfe12f70b8700bfc13ef6a0d6e9c3d62bb8af..35c59c3e8edc86658cf955ceb61d3dce99b8ee56 100644
--- a/ui/views/controls/label.h
+++ b/ui/views/controls/label.h
@@ -135,7 +135,10 @@ class VIEWS_EXPORT Label : public View {
void OnEnabledChanged() override;
protected:
- void PaintText(gfx::Canvas* canvas);
+ // Paints the display text to |canvas|. It also draws the focus rectangle if
+ // necessary. Returns the bounds of the focus rectangle (or an empty rectangle
+ // if this is not focusable).
+ gfx::Rect PaintText(gfx::Canvas* canvas);
SkColor disabled_color() const { return actual_disabled_color_; }
@@ -150,6 +153,7 @@ class VIEWS_EXPORT Label : public View {
FRIEND_TEST_ALL_PREFIXES(LabelTest, ResetRenderTextData);
FRIEND_TEST_ALL_PREFIXES(LabelTest, MultilineSupportedRenderText);
FRIEND_TEST_ALL_PREFIXES(LabelTest, TextChangeWithoutLayout);
+ FRIEND_TEST_ALL_PREFIXES(LabelFocusTest, FocusBounds);
void Init(const base::string16& text, const gfx::FontList& font_list);

Powered by Google App Engine
This is Rietveld 408576698