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

Unified Diff: ui/views/controls/focus_ring.cc

Issue 2813353002: Ensure that the focus ring in the bookmarks bar does not paint outside the parent view. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/focus_ring.cc
diff --git a/ui/views/controls/focus_ring.cc b/ui/views/controls/focus_ring.cc
index b905823817e7bdb568f0a5be6395b953226dec06..70400b8e0c3794247670ad3d1e9ffeb0304e5950 100644
--- a/ui/views/controls/focus_ring.cc
+++ b/ui/views/controls/focus_ring.cc
@@ -40,6 +40,9 @@ views::View* FocusRing::Install(views::View* parent,
if (!ring) {
ring = new FocusRing();
parent->AddChildView(ring);
+ // A layer is necessary to paint beyond the parent's bounds.
+ ring->SetPaintToLayer();
+ ring->layer()->SetFillsBoundsOpaquely(false);
}
ring->override_color_id_ = override_color_id;
ring->Layout();
@@ -86,9 +89,6 @@ void FocusRing::OnPaint(gfx::Canvas* canvas) {
FocusRing::FocusRing()
: override_color_id_(ui::NativeTheme::kColorId_NumColors) {
- // A layer is necessary to paint beyond the parent's bounds.
- SetPaintToLayer();
ananta 2017/04/12 23:54:04 Moved this code to FocusRing::Install() as we need
- layer()->SetFillsBoundsOpaquely(false);
}
FocusRing::~FocusRing() {}
« no previous file with comments | « no previous file | ui/views/controls/scroll_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698