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

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

Issue 1909453004: [Mac][Material Design] Adjust EV chip to match Material Design spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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;
+}

Powered by Google App Engine
This is Rietveld 408576698