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

Unified Diff: chrome/browser/ui/cocoa/location_bar/web_intents_button_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
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.mm b/chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.mm
index 5551c6e7b29d019017202fd2ab8f114c85c18683..ff696962bb1830339400332d636a9d9d33d40dae 100644
--- a/chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.mm
@@ -27,7 +27,6 @@ const NSTimeInterval kAnimationIntervalS = 1.0 / 60.0;
const CGFloat kTextMarginPadding = 4;
const CGFloat kIconMarginPadding = 2;
const CGFloat kBorderPadding = 3;
-const CGFloat kBubbleYInset = 4.0;
// During animation, the text opens to full width.
enum AnimationState {
@@ -161,9 +160,10 @@ bool WebIntentsButtonDecoration::OnMousePressed(NSRect frame) {
// Override to handle the case where there is text to display during the
// animation. The width is based on the animator's progress.
-CGFloat WebIntentsButtonDecoration::GetWidthForSpace(CGFloat width) {
+CGFloat WebIntentsButtonDecoration::GetWidthForSpace(CGFloat width,
+ CGFloat text_width) {
if (!animation_)
- return BubbleDecoration::GetWidthForSpace(width);
+ return BubbleDecoration::GetWidthForSpace(width, text_width);
AnimationState state = [animation_ animationState];
CGFloat progress = [animation_ progress];
@@ -187,7 +187,7 @@ void WebIntentsButtonDecoration::DrawInFrame(NSRect frame,
return;
}
- frame = NSInsetRect(frame, 0.0, kBubbleYInset);
+ frame = NSInsetRect(frame, 0.0, kTextYInset);
NSDrawThreePartImage(frame,
left_image_.get(),
center_image_.get(),
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/web_intents_button_decoration.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698