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

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

Issue 3017055: Merge 54767 - [Mac] M6 Omnibox positioning changes.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: 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/image_decoration.mm
===================================================================
--- chrome/browser/cocoa/location_bar/image_decoration.mm (revision 54836)
+++ chrome/browser/cocoa/location_bar/image_decoration.mm (working copy)
@@ -27,9 +27,12 @@
if (!image)
return frame;
+ // Center the image within the frame.
const CGFloat delta_height = NSHeight(frame) - [image size].height;
const CGFloat y_inset = std::floor(delta_height / 2.0);
- return NSInsetRect(frame, 0.0, y_inset);
+ const CGFloat delta_width = NSWidth(frame) - [image size].width;
+ const CGFloat x_inset = std::floor(delta_width / 2.0);
+ return NSInsetRect(frame, x_inset, y_inset);
}
CGFloat ImageDecoration::GetWidthForSpace(CGFloat width) {

Powered by Google App Engine
This is Rietveld 408576698