diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 00:09:28 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 00:09:28 +0000 |
commit | 6673317aabd12e4575027ed300d006f9e2bc3824 (patch) | |
tree | a8d889c3d1e3590d98e731dc55ba8963ff1f335e /chrome/browser/autofill/autofill_text_field_mac.mm | |
parent | 1804aa715fd72666c7c22d2cf6a773ecbd6eb43d (diff) | |
download | chromium_src-6673317aabd12e4575027ed300d006f9e2bc3824.zip chromium_src-6673317aabd12e4575027ed300d006f9e2bc3824.tar.gz chromium_src-6673317aabd12e4575027ed300d006f9e2bc3824.tar.bz2 |
Mac: clang build
Fixes the last few warnings / errors necessary to build chrome/mac with clang.
See http://code.google.com/p/chromium/wiki/Clang
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2762014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60131 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill/autofill_text_field_mac.mm')
-rw-r--r-- | chrome/browser/autofill/autofill_text_field_mac.mm | 12 |
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)); |