| 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <iosfwd> | 10 #include <iosfwd> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void GetMatchingTypes(const base::string16& text, | 58 void GetMatchingTypes(const base::string16& text, |
| 59 const std::string& app_locale, | 59 const std::string& app_locale, |
| 60 ServerFieldTypeSet* matching_types) const override; | 60 ServerFieldTypeSet* matching_types) const override; |
| 61 base::string16 GetRawInfo(ServerFieldType type) const override; | 61 base::string16 GetRawInfo(ServerFieldType type) const override; |
| 62 void SetRawInfo(ServerFieldType type, const base::string16& value) override; | 62 void SetRawInfo(ServerFieldType type, const base::string16& value) override; |
| 63 base::string16 GetInfo(const AutofillType& type, | 63 base::string16 GetInfo(const AutofillType& type, |
| 64 const std::string& app_locale) const override; | 64 const std::string& app_locale) const override; |
| 65 bool SetInfo(const AutofillType& type, | 65 bool SetInfo(const AutofillType& type, |
| 66 const base::string16& value, | 66 const base::string16& value, |
| 67 const std::string& app_locale) override; | 67 const std::string& app_locale) override; |
| 68 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; |
| 68 | 69 |
| 69 // How this card is stored. | 70 // How this card is stored. |
| 70 RecordType record_type() const { return record_type_; } | 71 RecordType record_type() const { return record_type_; } |
| 71 void set_record_type(RecordType type) { record_type_ = type; } | 72 void set_record_type(RecordType type) { record_type_ = type; } |
| 72 | 73 |
| 73 // Returns true if there are no values (field types) set. | 74 // Returns true if there are no values (field types) set. |
| 74 bool IsEmpty(const std::string& app_locale) const; | 75 bool IsEmpty(const std::string& app_locale) const; |
| 75 | 76 |
| 76 // Returns true if the |type| of data in this profile is present, but invalid. | 77 // Returns true if the |type| of data in this profile is present, but invalid. |
| 77 // Otherwise returns false. | 78 // Otherwise returns false. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 previous_use_date_ = time; | 185 previous_use_date_ = time; |
| 185 } | 186 } |
| 186 | 187 |
| 187 // Valid only when |record_type()| == |SERVER_PROFILE|. | 188 // Valid only when |record_type()| == |SERVER_PROFILE|. |
| 188 bool has_converted() const { return has_converted_; } | 189 bool has_converted() const { return has_converted_; } |
| 189 void set_has_converted(bool has_converted) { has_converted_ = has_converted; } | 190 void set_has_converted(bool has_converted) { has_converted_ = has_converted; } |
| 190 | 191 |
| 191 private: | 192 private: |
| 192 typedef std::vector<const FormGroup*> FormGroupList; | 193 typedef std::vector<const FormGroup*> FormGroupList; |
| 193 | 194 |
| 194 // FormGroup: | |
| 195 void GetSupportedTypes(ServerFieldTypeSet* supported_types) const override; | |
| 196 | |
| 197 // Creates inferred labels for |profiles| at indices corresponding to | 195 // Creates inferred labels for |profiles| at indices corresponding to |
| 198 // |indices|, and stores the results to the corresponding elements of | 196 // |indices|, and stores the results to the corresponding elements of |
| 199 // |labels|. These labels include enough fields to differentiate among the | 197 // |labels|. These labels include enough fields to differentiate among the |
| 200 // profiles, if possible; and also at least |num_fields_to_include| fields, if | 198 // profiles, if possible; and also at least |num_fields_to_include| fields, if |
| 201 // possible. The label fields are drawn from |fields|. | 199 // possible. The label fields are drawn from |fields|. |
| 202 static void CreateInferredLabelsHelper( | 200 static void CreateInferredLabelsHelper( |
| 203 const std::vector<AutofillProfile*>& profiles, | 201 const std::vector<AutofillProfile*>& profiles, |
| 204 const std::list<size_t>& indices, | 202 const std::list<size_t>& indices, |
| 205 const std::vector<ServerFieldType>& fields, | 203 const std::vector<ServerFieldType>& fields, |
| 206 size_t num_fields_to_include, | 204 size_t num_fields_to_include, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // converted to a local profile. | 237 // converted to a local profile. |
| 240 bool has_converted_; | 238 bool has_converted_; |
| 241 }; | 239 }; |
| 242 | 240 |
| 243 // So we can compare AutofillProfiles with EXPECT_EQ(). | 241 // So we can compare AutofillProfiles with EXPECT_EQ(). |
| 244 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); | 242 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); |
| 245 | 243 |
| 246 } // namespace autofill | 244 } // namespace autofill |
| 247 | 245 |
| 248 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ | 246 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ |
| OLD | NEW |