OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/core/browser/personal_data_manager.h" | 5 #include "components/autofill/core/browser/personal_data_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // If the |field_type| and |value| don't pass basic validity checks then | 272 // If the |field_type| and |value| don't pass basic validity checks then |
273 // abandon the import. | 273 // abandon the import. |
274 if (!IsValidFieldTypeAndValue(types_seen, field_type, value)) { | 274 if (!IsValidFieldTypeAndValue(types_seen, field_type, value)) { |
275 imported_profile.reset(); | 275 imported_profile.reset(); |
276 local_imported_credit_card.reset(); | 276 local_imported_credit_card.reset(); |
277 break; | 277 break; |
278 } | 278 } |
279 | 279 |
280 types_seen.insert(field_type); | 280 types_seen.insert(field_type); |
281 | 281 |
282 if (group == AutofillType::CREDIT_CARD) { | 282 if (group == CREDIT_CARD) { |
283 if (LowerCaseEqualsASCII(field->form_control_type, "month")) { | 283 if (LowerCaseEqualsASCII(field->form_control_type, "month")) { |
284 DCHECK_EQ(CREDIT_CARD_EXP_MONTH, field_type); | 284 DCHECK_EQ(CREDIT_CARD_EXP_MONTH, field_type); |
285 local_imported_credit_card->SetInfoForMonthInputType(value); | 285 local_imported_credit_card->SetInfoForMonthInputType(value); |
286 } else { | 286 } else { |
287 local_imported_credit_card->SetInfo(field_type, value, app_locale_); | 287 local_imported_credit_card->SetInfo(field_type, value, app_locale_); |
288 } | 288 } |
289 ++importable_credit_card_fields; | 289 ++importable_credit_card_fields; |
290 } else { | 290 } else { |
291 // We need to store phone data in the variables, before building the whole | 291 // We need to store phone data in the variables, before building the whole |
292 // number at the end. The rest of the fields are set "as is". | 292 // number at the end. The rest of the fields are set "as is". |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 const AutofillMetrics* metric_logger) { | 1017 const AutofillMetrics* metric_logger) { |
1018 metric_logger_.reset(metric_logger); | 1018 metric_logger_.reset(metric_logger); |
1019 } | 1019 } |
1020 | 1020 |
1021 void PersonalDataManager::set_browser_context( | 1021 void PersonalDataManager::set_browser_context( |
1022 content::BrowserContext* context) { | 1022 content::BrowserContext* context) { |
1023 browser_context_ = context; | 1023 browser_context_ = context; |
1024 } | 1024 } |
1025 | 1025 |
1026 } // namespace autofill | 1026 } // namespace autofill |
OLD | NEW |