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

Unified Diff: chrome/browser/ui/cocoa/location_bar/content_setting_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/content_setting_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
index b248205bd9e6454db9fb708f85c1b9c238b94c5f..02656a3f15fa8c572ea3eafacf3d05edeb9318aa 100644
--- a/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/content_setting_decoration.mm
@@ -296,8 +296,10 @@ void ContentSettingDecoration::SetToolTip(NSString* tooltip) {
// Override to handle the case where there is text to display during the
// animation. The width is based on the animator's progress.
-CGFloat ContentSettingDecoration::GetWidthForSpace(CGFloat width) {
- CGFloat preferred_width = ImageDecoration::GetWidthForSpace(width);
+CGFloat ContentSettingDecoration::GetWidthForSpace(CGFloat width,
+ CGFloat text_width) {
+ CGFloat preferred_width =
+ ImageDecoration::GetWidthForSpace(width, text_width);
if (animation_.get()) {
AnimationState state = [animation_ animationState];
if (state != kNoAnimation) {
@@ -364,7 +366,7 @@ void ContentSettingDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
// rect.
NSRect remainder = frame;
remainder.origin.x = NSMaxX(icon_rect);
- NSInsetRect(remainder, kTextMarginPadding, kTextMarginPadding);
+ NSInsetRect(remainder, kTextMarginPadding, kTextYInset);
// .get() needed to fix compiler warning (confusion with NSImageRep).
[animated_text_.get() drawAtPoint:remainder.origin];
} else {

Powered by Google App Engine
This is Rietveld 408576698