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

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: More comment fixes. 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..f33aeceb0727a7f4328b1bee32c6ae314a6036ac 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
@@ -39,14 +42,10 @@ const CGFloat kLabelInset = 3.0;
[label_ setBordered:NO];
[label_ setDrawsBackground:NO];
[label_ setStringValue:message];
- NSSize labelSize = [[label_ cell] cellSizeForBounds:
- NSMakeRect(
- 0, 0,
- 2 * autofill::kFieldWidth + autofill::kHorizontalFieldPadding,
- CGFLOAT_MAX)];
- [label_ setFrameSize:labelSize];
- [label_ setFrameOrigin:NSMakePoint(kLabelInset, kLabelInset)];
-
+ NSRect labelFrame = NSMakeRect(kLabelInset, kLabelInset, 0, 0);
+ labelFrame.size = [[label_ cell] cellSizeForBounds:
+ NSMakeRect(0, 0, kMaxLabelWidth, CGFLOAT_MAX)];
+ [label_ setFrame:labelFrame];
[[self bubble] addSubview:label_];
NSRect windowFrame = [[self window] frame];
@@ -59,4 +58,8 @@ const CGFloat kLabelInset = 3.0;
return self;
}
+- (CGFloat)maxWidth {
+ return kMaxLabelWidth + 2 * kLabelInset;
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698