| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" | 5 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 const RegToFieldMap& reg_to_field ) { | 128 const RegToFieldMap& reg_to_field ) { |
| 129 DCHECK(profile != NULL); | 129 DCHECK(profile != NULL); |
| 130 if (!key->Valid()) | 130 if (!key->Valid()) |
| 131 return false; | 131 return false; |
| 132 | 132 |
| 133 bool has_non_empty_fields = false; | 133 bool has_non_empty_fields = false; |
| 134 | 134 |
| 135 // Phones need to be rebuilt. | 135 // Phones need to be rebuilt. |
| 136 PhoneNumber::PhoneCombineHelper phone; | 136 PhoneNumber::PhoneCombineHelper phone; |
| 137 | 137 |
| 138 for (uint32 value_index = 0; value_index < key->ValueCount(); ++value_index) { | 138 for (uint32 i = 0; i < key->GetValueCount(); ++i) { |
| 139 std::wstring value_name; | 139 std::wstring value_name; |
| 140 if (key->ReadName(value_index, &value_name) != ERROR_SUCCESS) | 140 if (key->GetValueNameAt(i, &value_name) != ERROR_SUCCESS) |
| 141 continue; | 141 continue; |
| 142 RegToFieldMap::const_iterator it = reg_to_field.find(value_name); | 142 RegToFieldMap::const_iterator it = reg_to_field.find(value_name); |
| 143 if (it == reg_to_field.end()) | 143 if (it == reg_to_field.end()) |
| 144 continue; // This field is not imported. | 144 continue; // This field is not imported. |
| 145 string16 field_value = ReadAndDecryptValue(key, value_name.c_str()); | 145 string16 field_value = ReadAndDecryptValue(key, value_name.c_str()); |
| 146 if (!field_value.empty()) { | 146 if (!field_value.empty()) { |
| 147 has_non_empty_fields = true; | 147 has_non_empty_fields = true; |
| 148 if (it->second == CREDIT_CARD_NUMBER) | 148 if (it->second == CREDIT_CARD_NUMBER) |
| 149 field_value = DecryptCCNumber(field_value); | 149 field_value = DecryptCCNumber(field_value); |
| 150 | 150 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 | 266 |
| 267 bool ImportAutofillDataWin(PersonalDataManager* pdm) { | 267 bool ImportAutofillDataWin(PersonalDataManager* pdm) { |
| 268 // In incognito mode we do not have PDM - and we should not import anything. | 268 // In incognito mode we do not have PDM - and we should not import anything. |
| 269 if (!pdm) | 269 if (!pdm) |
| 270 return false; | 270 return false; |
| 271 AutofillImporter *importer = new AutofillImporter(pdm); | 271 AutofillImporter *importer = new AutofillImporter(pdm); |
| 272 // importer will self delete. | 272 // importer will self delete. |
| 273 return importer->ImportProfiles(); | 273 return importer->ImportProfiles(); |
| 274 } | 274 } |
| 275 | 275 |
| OLD | NEW |