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

Unified Diff: chrome/browser/autofill/autofill_text_field_mac.mm

Issue 2762014: Mac: clang build (Closed)
Patch Set: comments Created 10 years, 3 months 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/autofill/autofill_text_field_mac.mm
diff --git a/chrome/browser/autofill/autofill_text_field_mac.mm b/chrome/browser/autofill/autofill_text_field_mac.mm
index 509b1a6e3c65f0035a6380d53537d645e322e355..5db2ffbddc161fec348dee0b730c22cb24152f66 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));

Powered by Google App Engine
This is Rietveld 408576698