summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill/autofill_text_field_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/autofill/autofill_text_field_mac.mm')
-rw-r--r--chrome/browser/autofill/autofill_text_field_mac.mm12
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome/browser/autofill/autofill_text_field_mac.mm b/chrome/browser/autofill/autofill_text_field_mac.mm
index 509b1a6..5db2ffb 100644
--- a/chrome/browser/autofill/autofill_text_field_mac.mm
+++ b/chrome/browser/autofill/autofill_text_field_mac.mm
@@ -24,10 +24,16 @@
}
}
-- (void)setObjectValue:(id)object {
- if (isCreditCardField_ && [object isKindOfClass:[NSString class]]) {
+- (void)setObjectValue:(id<NSCopying>)anObject {
+ // -[NSControl setObjectValue:] says that the passed-in object has type
+ // |id<NSCopying>|, but this function needs to call the NSObject method
+ // -isKindOfClass: on the parameter. In theory, this is not correct, but this
+ // is probably a bug in the method signature.
+ NSObject<NSCopying>* object = static_cast<NSObject<NSCopying>*>(anObject);
+ if (isCreditCardField_ &&
+ [object isKindOfClass:[NSString class]]) {
// Obfuscate the number.
- NSString* string = object;
+ NSString* string = static_cast<NSString*>(object);
CreditCard card;
card.SetInfo(AutoFillType(CREDIT_CARD_NUMBER),
base::SysNSStringToUTF16(string));