Index: chrome/browser/ui/cocoa/autofill/autofill_main_container.mm |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm |
index d46fa8d97c7536e01de18cada2a5fa64a5cb3725..46acb3a12fae1a1510b56176240db31d1a1d0e21 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_main_container.mm |
@@ -19,6 +19,7 @@ |
#import "chrome/browser/ui/cocoa/key_equivalent_constants.h" |
#include "grit/generated_resources.h" |
#include "grit/theme_resources.h" |
+#include "skia/ext/skia_utils_mac.h" |
#import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" |
#include "ui/base/cocoa/window_size_constants.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -30,6 +31,13 @@ namespace { |
// has a total of 30px - but 10px are already provided by details/suggestions. |
const CGFloat kButtonVerticalPadding = 20.0; |
+// Padding around the text for the legal documents. |
+const CGFloat kLegalDocumentsPadding = 20.0; |
+ |
+// The font color for the legal documents text. Set to match the Views |
+// implementation. |
+const SkColor kLegalDocumentsTextColor = SkColorSetRGB(102, 102, 102); |
groby-ooo-7-16
2013/11/22 14:03:28
Doesn't this add a static ctor?
Ilya Sherman
2013/11/22 22:13:52
Nope, because SkColor is defined as "typedef uint3
groby-ooo-7-16
2013/11/22 22:23:48
Yes, but SkColorSetRGB is a function - which needs
Ilya Sherman
2013/11/22 22:26:38
Pretty sure that's fine, as there aren't any objec
|
+ |
} // namespace |
@interface AutofillMainContainer (Private) |
@@ -100,6 +108,8 @@ const CGFloat kButtonVerticalPadding = 20.0; |
blue:0.96 |
alpha:1.0]]; |
[legalDocumentsView_ setDrawsBackground:YES]; |
+ [legalDocumentsView_ setTextContainerInset: |
+ NSMakeSize(kLegalDocumentsPadding, kLegalDocumentsPadding)]; |
[legalDocumentsView_ setHidden:YES]; |
[legalDocumentsView_ setDelegate:self]; |
legalDocumentsSizeDirty_ = YES; |
@@ -267,6 +277,9 @@ const CGFloat kButtonVerticalPadding = 20.0; |
[legalDocumentsView_ setFrame:currentFrame]; |
newFrame.size.width = width; |
+ // Account for the padding around the text. |
+ newFrame.size.height += 2 * kLegalDocumentsPadding; |
+ |
legalDocumentsSizeDirty_ = NO; |
legalDocumentsSize_ = newFrame.size; |
return legalDocumentsSize_; |
@@ -291,10 +304,10 @@ const CGFloat kButtonVerticalPadding = 20.0; |
NSString* text = base::SysUTF16ToNSString(delegate_->LegalDocumentsText()); |
if ([text length]) { |
- NSFont* font = [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]; |
- [legalDocumentsView_ setMessage:text |
- withFont:font |
- messageColor:[NSColor blackColor]]; |
+ NSFont* font = |
+ [NSFont labelFontOfSize:[[legalDocumentsView_ font] pointSize]]; |
+ NSColor* color = gfx::SkColorToCalibratedNSColor(kLegalDocumentsTextColor); |
+ [legalDocumentsView_ setMessage:text withFont:font messageColor:color]; |
const std::vector<gfx::Range>& link_ranges = |
delegate_->LegalDocumentLinks(); |