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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_bubble_controller.mm

Issue 82593002: [rAC, OSX] Align bubble arrow based on location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/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

Powered by Google App Engine
This is Rietveld 408576698