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

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

Issue 2870059: [Mac] Adjust omnibox decoration dragging to keep image under mouse. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Move method per Trung. Created 10 years, 5 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/cocoa/location_bar/bubble_decoration.mm
diff --git a/chrome/browser/cocoa/location_bar/bubble_decoration.mm b/chrome/browser/cocoa/location_bar/bubble_decoration.mm
index 5a85a9c6bf83ecd2da7ad1a32939b44bb3e43be3..5e2a9ad2789c5fa379465063a9b7afc8aff3c3c4 100644
--- a/chrome/browser/cocoa/location_bar/bubble_decoration.mm
+++ b/chrome/browser/cocoa/location_bar/bubble_decoration.mm
@@ -43,6 +43,13 @@ CGFloat BubbleDecoration::GetWidthForImageAndLabel(NSImage* image,
return kBubblePadding + image_width + label_width;
}
+NSRect BubbleDecoration::GetImageRectInFrame(NSRect frame) {
+ NSRect imageRect = NSInsetRect(frame, 0.0, kKeywordYInset);
+ if (image_)
+ imageRect.size = [image_ size];
+ return imageRect;
+}
+
CGFloat BubbleDecoration::GetWidthForSpace(CGFloat width) {
const CGFloat all_width = GetWidthForImageAndLabel(image_, label_);
if (all_width <= width)
« no previous file with comments | « chrome/browser/cocoa/location_bar/bubble_decoration.h ('k') | chrome/browser/cocoa/location_bar/ev_bubble_decoration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698