OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" | 5 #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" |
6 #include "app/l10n_util.h" | 6 #include "app/l10n_util.h" |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 | 584 |
585 return 0; | 585 return 0; |
586 } | 586 } |
587 | 587 |
588 - (NSArray*)addressLabels { | 588 - (NSArray*)addressLabels { |
589 NSUInteger capacity = profiles_.size(); | 589 NSUInteger capacity = profiles_.size(); |
590 NSMutableArray* array = [NSMutableArray arrayWithCapacity:capacity]; | 590 NSMutableArray* array = [NSMutableArray arrayWithCapacity:capacity]; |
591 | 591 |
592 std::vector<AutoFillProfile>::iterator i; | 592 std::vector<AutoFillProfile>::iterator i; |
593 for (i = profiles_.begin(); i != profiles_.end(); ++i) { | 593 for (i = profiles_.begin(); i != profiles_.end(); ++i) { |
| 594 FieldTypeSet fields; |
| 595 i->GetAvailableFieldTypes(&fields); |
| 596 if (fields.find(ADDRESS_HOME_LINE1) == fields.end() && |
| 597 fields.find(ADDRESS_HOME_LINE2) == fields.end() && |
| 598 fields.find(ADDRESS_HOME_APT_NUM) == fields.end() && |
| 599 fields.find(ADDRESS_HOME_CITY) == fields.end() && |
| 600 fields.find(ADDRESS_HOME_STATE) == fields.end() && |
| 601 fields.find(ADDRESS_HOME_ZIP) == fields.end() && |
| 602 fields.find(ADDRESS_HOME_COUNTRY) == fields.end()) { |
| 603 // No address information in this profile; it's useless as a billing |
| 604 // address. |
| 605 continue; |
| 606 } |
594 [array addObject:SysUTF16ToNSString(i->Label())]; | 607 [array addObject:SysUTF16ToNSString(i->Label())]; |
595 } | 608 } |
596 | 609 |
597 return array; | 610 return array; |
598 } | 611 } |
599 | 612 |
600 @end | 613 @end |
601 | 614 |
602 @implementation AutoFillDialogController (ExposedForUnitTests) | 615 @implementation AutoFillDialogController (ExposedForUnitTests) |
603 | 616 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 if (!image) { | 841 if (!image) { |
829 image = rb.GetNSImageNamed(IDR_INPUT_GOOD); | 842 image = rb.GetNSImageNamed(IDR_INPUT_GOOD); |
830 DCHECK(image); | 843 DCHECK(image); |
831 return image; | 844 return image; |
832 } | 845 } |
833 | 846 |
834 return nil; | 847 return nil; |
835 } | 848 } |
836 | 849 |
837 @end | 850 @end |
OLD | NEW |