Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| diff --git a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| index ba2e49238f6c29c7915df4a9d5bb88369cf241dd..3a6ad5b6d9e7735240ebdeb27aeca487c89550d8 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| +++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm |
| @@ -31,7 +31,8 @@ const CGFloat kBackgroundYInset = 4.0; |
| } // namespace |
| -BubbleDecoration::BubbleDecoration() { |
| +BubbleDecoration::BubbleDecoration() |
| + : baseline_offset_(0) { |
|
tapted
2016/04/22 00:41:52
nit: put on the line above? - pretty sure that's w
shrike
2016/04/26 18:03:40
Done.
|
| attributes_.reset([[NSMutableDictionary alloc] init]); |
| [attributes_ setObject:GetFont() forKey:NSFontAttributeName]; |
| } |
| @@ -102,6 +103,7 @@ void BubbleDecoration::DrawInFrame(NSRect frame, NSView* control_view) { |
| if (label_) { |
| NSRect textRect = frame; |
| textRect.origin.x = textOffset; |
| + textRect.origin.y += baseline_offset_; |
| textRect.size.width = NSMaxX(decoration_frame) - NSMinX(textRect); |
| DrawLabel(label_, attributes_, textRect); |
| } |
| @@ -154,3 +156,11 @@ void BubbleDecoration::SetLabel(NSString* label) { |
| void BubbleDecoration::SetTextColor(NSColor* text_color) { |
| [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName]; |
| } |
| + |
| +void BubbleDecoration::SetFont(NSFont* font) { |
| + [attributes_ setObject:font forKey:NSFontAttributeName]; |
| +} |
| + |
| +void BubbleDecoration::SetBaselineOffset(CGFloat offset) { |
| + baseline_offset_ = offset; |
| +} |