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

Unified Diff: chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm

Issue 2847903003: cocoa: don't draw focus rings over the URL scheme in the location bar (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 | « chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
index 14b40ac626da8b2c3809e79c530bbaca5b210288..2a8efd6d0a80757f4b46226debf7ec729781568f 100644
--- a/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
@@ -151,6 +151,7 @@
CGFloat text_left_offset = NSMinX(decoration_frame);
CGFloat text_right_offset = NSMaxX(decoration_frame);
const BOOL is_rtl = cocoa_l10n_util::ShouldDoExperimentalRTLLayout();
+ focus_ring_right_inset_ = 0;
if (image_) {
// The image should fade in if we're animating in.
CGFloat image_alpha =
@@ -247,6 +248,12 @@
divider_color = [divider_color colorWithAlphaComponent:divider_alpha];
[divider_color set];
[line stroke];
+
+ focus_ring_right_inset_ = DividerPadding() + line_width;
+ } else {
+ // When mouse-hovered, the divider isn't drawn, but the padding for it is
+ // still present to separate the button from the location bar text.
+ focus_ring_right_inset_ = DividerPadding();
}
}
}
@@ -292,6 +299,12 @@
stringWithFormat:@"%@. %@", full_label_.get(), tooltip_icon_text];
}
+NSRect SecurityStateBubbleDecoration::GetRealFocusRingBounds(
+ NSRect bounds) const {
+ bounds.size.width -= focus_ring_right_inset_;
+ return bounds;
+}
+
//////////////////////////////////////////////////////////////////
// SecurityStateBubbleDecoration::BubbleDecoration:
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698