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

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

Issue 12042002: Alternate NTP: Add search token to omnibox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 7 years, 11 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 c33fa893da5d85b4942a4c0bf592cd2e95ef5f51..d13858473c2965929cb07defae2123ee22e47d89 100644
--- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
@@ -23,13 +23,6 @@ const CGFloat kLeftSideOverdraw = 2.0;
// Omnibox corner radius is |4.0|, this needs to look tight WRT that.
const CGFloat kBubbleCornerRadius = 2.0;
-// How far to inset the bubble from the top and bottom of the drawing
-// frame.
-// TODO(shess): Would be nicer to have the drawing code factor out the
-// space outside the border, and perhaps the border. Then this could
-// reflect the single pixel space w/in that.
-const CGFloat kBubbleYInset = 4.0;
-
// Padding between the icon and label.
const CGFloat kIconLabelPadding = 4.0;
@@ -66,7 +59,7 @@ CGFloat BubbleDecoration::GetWidthForImageAndLabel(NSImage* image,
}
NSRect BubbleDecoration::GetImageRectInFrame(NSRect frame) {
- NSRect imageRect = NSInsetRect(frame, 0.0, kBubbleYInset);
+ NSRect imageRect = NSInsetRect(frame, 0.0, kTextYInset);
if (image_) {
// Center the image vertically.
const NSSize imageSize = [image_ size];
@@ -77,7 +70,7 @@ NSRect BubbleDecoration::GetImageRectInFrame(NSRect frame) {
return imageRect;
}
-CGFloat BubbleDecoration::GetWidthForSpace(CGFloat width) {
+CGFloat BubbleDecoration::GetWidthForSpace(CGFloat width, CGFloat text_width) {
const CGFloat all_width = GetWidthForImageAndLabel(image_, label_);
if (all_width <= width)
return all_width;
@@ -90,7 +83,7 @@ CGFloat BubbleDecoration::GetWidthForSpace(CGFloat width) {
}
void BubbleDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
- const NSRect decorationFrame = NSInsetRect(frame, 0.0, kBubbleYInset);
+ const NSRect decorationFrame = NSInsetRect(frame, 0.0, kTextYInset);
// The inset is to put the border down the middle of the pixel.
NSRect bubbleFrame = NSInsetRect(decorationFrame, 0.5, 0.5);
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/bubble_decoration.h ('k') | chrome/browser/ui/cocoa/location_bar/button_decoration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698