| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 ServerFieldType excluded_field, | 172 ServerFieldType excluded_field, |
| 173 size_t minimal_fields_shown, | 173 size_t minimal_fields_shown, |
| 174 const std::string& app_locale, | 174 const std::string& app_locale, |
| 175 std::vector<base::string16>* labels); | 175 std::vector<base::string16>* labels); |
| 176 | 176 |
| 177 const std::string& language_code() const { return language_code_; } | 177 const std::string& language_code() const { return language_code_; } |
| 178 void set_language_code(const std::string& language_code) { | 178 void set_language_code(const std::string& language_code) { |
| 179 language_code_ = language_code; | 179 language_code_ = language_code; |
| 180 } | 180 } |
| 181 | 181 |
| 182 // Nonempty only when type() == SERVER_PROFILE. | 182 // Creates an identifier and saves it as a server ID. The server doesn't |
| 183 const std::string& server_id() const { return server_id_; } | 183 // attach an identifier so Chrome creates its own. The ID is a hash of the |
| 184 | 184 // data contained in the profile. |
| 185 // Creates an identifier and saves it as |server_id_|. Only used for | |
| 186 // server credit cards. The server doesn't attach an identifier so Chrome | |
| 187 // creates its own. The ID is a hash of the data contained in the profile. | |
| 188 void GenerateServerProfileIdentifier(); | 185 void GenerateServerProfileIdentifier(); |
| 189 | 186 |
| 190 // Returns a standardized representation of the given string for comparison | 187 // Returns a standardized representation of the given string for comparison |
| 191 // purposes. The resulting string will be lower-cased with all punctuation | 188 // purposes. The resulting string will be lower-cased with all punctuation |
| 192 // substituted by spaces. Whitespace will be converted to ASCII space, and | 189 // substituted by spaces. Whitespace will be converted to ASCII space, and |
| 193 // multiple whitespace characters will be collapsed. | 190 // multiple whitespace characters will be collapsed. |
| 194 // | 191 // |
| 195 // This string is designed for comparison purposes only and isn't suitable | 192 // This string is designed for comparison purposes only and isn't suitable |
| 196 // for storing or displaying to the user. | 193 // for storing or displaying to the user. |
| 197 static base::string16 CanonicalizeProfileString(const base::string16& str); | 194 static base::string16 CanonicalizeProfileString(const base::string16& str); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 252 |
| 256 // Personal information for this profile. | 253 // Personal information for this profile. |
| 257 std::vector<NameInfo> name_; | 254 std::vector<NameInfo> name_; |
| 258 std::vector<EmailInfo> email_; | 255 std::vector<EmailInfo> email_; |
| 259 CompanyInfo company_; | 256 CompanyInfo company_; |
| 260 std::vector<PhoneNumber> phone_number_; | 257 std::vector<PhoneNumber> phone_number_; |
| 261 Address address_; | 258 Address address_; |
| 262 | 259 |
| 263 // The BCP 47 language code that can be used to format |address_| for display. | 260 // The BCP 47 language code that can be used to format |address_| for display. |
| 264 std::string language_code_; | 261 std::string language_code_; |
| 265 | |
| 266 // ID used for identifying this profile. Only set for SERVER_PROFILEs. This is | |
| 267 // a hash of the contents. | |
| 268 std::string server_id_; | |
| 269 }; | 262 }; |
| 270 | 263 |
| 271 // So we can compare AutofillProfiles with EXPECT_EQ(). | 264 // So we can compare AutofillProfiles with EXPECT_EQ(). |
| 272 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); | 265 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); |
| 273 | 266 |
| 274 } // namespace autofill | 267 } // namespace autofill |
| 275 | 268 |
| 276 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ | 269 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ |
| OLD | NEW |