| 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/form_group.h" | 5 #include "components/autofill/core/browser/form_group.h" |
| 6 | 6 |
| 7 #include "components/autofill/core/browser/autofill_profile.h" | 7 #include "components/autofill/core/browser/autofill_profile.h" |
| 8 #include "components/autofill/core/browser/autofill_profile_comparator.h" | 8 #include "components/autofill/core/browser/autofill_profile_comparator.h" |
| 9 #include "components/autofill/core/browser/autofill_type.h" | 9 #include "components/autofill/core/browser/autofill_type.h" |
| 10 #include "components/autofill/core/common/autofill_l10n_util.h" | 10 #include "components/autofill/core/common/autofill_l10n_util.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return GetRawInfo(type.GetStorableType()); | 50 return GetRawInfo(type.GetStorableType()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool FormGroup::SetInfo(const AutofillType& type, | 53 bool FormGroup::SetInfo(const AutofillType& type, |
| 54 const base::string16& value, | 54 const base::string16& value, |
| 55 const std::string& app_locale) { | 55 const std::string& app_locale) { |
| 56 SetRawInfo(type.GetStorableType(), value); | 56 SetRawInfo(type.GetStorableType(), value); |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool FormGroup::HasInfo(ServerFieldType type) const { |
| 61 return HasInfo(AutofillType(type)); |
| 62 } |
| 63 |
| 64 bool FormGroup::HasInfo(const AutofillType& type) const { |
| 65 // Use "en-US" as a placeholder locale. We are only interested in emptiness, |
| 66 // not in the presentation of the string. |
| 67 return !GetInfo(type, "en-US").empty(); |
| 68 } |
| 69 |
| 60 } // namespace autofill | 70 } // namespace autofill |
| OLD | NEW |