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

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

Issue 2478673002: [Mac] Hover/Pressed background for the Omnibox decorations (Closed)
Patch Set: nit Created 4 years, 1 month 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 714e4b291917a7a7243fea6be34e115729fa0506..8f8db5aecf9dbb2a695a52b186a4265861376621 100644
--- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
@@ -31,6 +31,12 @@ const CGFloat kIconLabelPadding = 4.0;
// Inset for the image frame.
const CGFloat kImageFrameYInset = 4.0;
+// Inset for the background frame.
+const CGFloat kBackgroundFrameYInset = 2.0;
+
+// Left margin for the background frame.
+const CGFloat kBackgroundFrameLeftMargin = 1.0;
+
} // namespace
BubbleDecoration::BubbleDecoration() : retina_baseline_offset_(0) {
@@ -93,6 +99,13 @@ CGFloat BubbleDecoration::GetWidthForSpace(CGFloat width) {
return kOmittedWidth;
}
+NSRect BubbleDecoration::GetBackgroundFrame(NSRect frame) {
+ NSRect background_frame = NSInsetRect(frame, 0.0, kBackgroundFrameYInset);
+ background_frame.origin.x += kBackgroundFrameLeftMargin;
+ background_frame.size.width -= kDividerPadding;
+ return background_frame;
+}
+
void BubbleDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
const NSRect decoration_frame = NSInsetRect(frame, 0.0, kImageFrameYInset);
CGFloat text_offset = NSMinX(decoration_frame);

Powered by Google App Engine
This is Rietveld 408576698