Index: chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.mm |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.mm b/chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.mm |
index 82e25620b893c45f809715c31a2b20dd7da073b4..09e7d77cbe461587ba538b44120c73b1aeb16fa7 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.mm |
@@ -14,6 +14,9 @@ namespace { |
// Border inset for error label. |
const CGFloat kLabelInset = 3.0; |
+const CGFloat kMaxLabelWidth = |
+ 2 * autofill::kFieldWidth + autofill::kHorizontalFieldPadding; |
+ |
} // namespace |
@@ -40,10 +43,7 @@ const CGFloat kLabelInset = 3.0; |
[label_ setDrawsBackground:NO]; |
[label_ setStringValue:message]; |
NSSize labelSize = [[label_ cell] cellSizeForBounds: |
- NSMakeRect( |
- 0, 0, |
- 2 * autofill::kFieldWidth + autofill::kHorizontalFieldPadding, |
- CGFLOAT_MAX)]; |
+ NSMakeRect(0, 0, kMaxLabelWidth, CGFLOAT_MAX)]; |
[label_ setFrameSize:labelSize]; |
[label_ setFrameOrigin:NSMakePoint(kLabelInset, kLabelInset)]; |
@@ -59,4 +59,8 @@ const CGFloat kLabelInset = 3.0; |
return self; |
} |
+- (CGFloat)maxWidth { |
+ return kMaxLabelWidth + 2 * kLabelInset; |
+} |
+ |
@end |