Chromium Code Reviews| 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 16 matching lines...) Expand all Loading... | |
| 27 // form information from the profile, and the profile will delegate the request | 27 // form information from the profile, and the profile will delegate the request |
| 28 // to the requested form group type. | 28 // to the requested form group type. |
| 29 class AutofillProfile : public AutofillDataModel { | 29 class AutofillProfile : public AutofillDataModel { |
| 30 public: | 30 public: |
| 31 enum RecordType { | 31 enum RecordType { |
| 32 // A profile stored and editable locally. | 32 // A profile stored and editable locally. |
| 33 LOCAL_PROFILE, | 33 LOCAL_PROFILE, |
| 34 | 34 |
| 35 // A profile synced down from the server. These are read-only locally. | 35 // A profile synced down from the server. These are read-only locally. |
| 36 SERVER_PROFILE, | 36 SERVER_PROFILE, |
| 37 | |
| 38 // An auxiliary profile. | |
|
please use gerrit instead
2015/03/12 20:40:12
nit: add and example (Mac AddressBook).
Evan Stade
2015/03/12 21:28:03
Done.
| |
| 39 AUXILIARY_PROFILE, | |
| 37 }; | 40 }; |
| 38 | 41 |
| 39 AutofillProfile(const std::string& guid, const std::string& origin); | 42 AutofillProfile(const std::string& guid, const std::string& origin); |
| 40 | 43 |
| 41 // Server profile constructor. The type must be SERVER_PROFILE (this serves | 44 // Server profile constructor. The type must be SERVER_PROFILE (this serves |
| 42 // to differentiate this constructor). | 45 // to differentiate this constructor). |
| 43 AutofillProfile(RecordType type, const std::string& server_id); | 46 AutofillProfile(RecordType type, const std::string& server_id); |
| 44 | 47 |
| 45 // For use in STL containers. | 48 // For use in STL containers. |
| 46 AutofillProfile(); | 49 AutofillProfile(); |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 62 const std::string& app_locale) override; | 65 const std::string& app_locale) override; |
| 63 | 66 |
| 64 // AutofillDataModel: | 67 // AutofillDataModel: |
| 65 base::string16 GetInfoForVariant( | 68 base::string16 GetInfoForVariant( |
| 66 const AutofillType& type, | 69 const AutofillType& type, |
| 67 size_t variant, | 70 size_t variant, |
| 68 const std::string& app_locale) const override; | 71 const std::string& app_locale) const override; |
| 69 | 72 |
| 70 // How this card is stored. | 73 // How this card is stored. |
| 71 RecordType record_type() const { return record_type_; } | 74 RecordType record_type() const { return record_type_; } |
| 75 void set_record_type(RecordType type) { record_type_ = type; } | |
| 72 | 76 |
| 73 // Multi-value equivalents to |GetInfo| and |SetInfo|. | 77 // Multi-value equivalents to |GetInfo| and |SetInfo|. |
| 74 void SetRawMultiInfo(ServerFieldType type, | 78 void SetRawMultiInfo(ServerFieldType type, |
| 75 const std::vector<base::string16>& values); | 79 const std::vector<base::string16>& values); |
| 76 void GetRawMultiInfo(ServerFieldType type, | 80 void GetRawMultiInfo(ServerFieldType type, |
| 77 std::vector<base::string16>* values) const; | 81 std::vector<base::string16>* values) const; |
| 78 void SetMultiInfo(const AutofillType& type, | 82 void SetMultiInfo(const AutofillType& type, |
| 79 const std::vector<base::string16>& values, | 83 const std::vector<base::string16>& values, |
| 80 const std::string& app_locale); | 84 const std::string& app_locale); |
| 81 void GetMultiInfo(const AutofillType& type, | 85 void GetMultiInfo(const AutofillType& type, |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 // ID assigned by the server. This will be set only for WALLET_PROFILEs. | 260 // ID assigned by the server. This will be set only for WALLET_PROFILEs. |
| 257 std::string server_id_; | 261 std::string server_id_; |
| 258 }; | 262 }; |
| 259 | 263 |
| 260 // So we can compare AutofillProfiles with EXPECT_EQ(). | 264 // So we can compare AutofillProfiles with EXPECT_EQ(). |
| 261 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); | 265 std::ostream& operator<<(std::ostream& os, const AutofillProfile& profile); |
| 262 | 266 |
| 263 } // namespace autofill | 267 } // namespace autofill |
| 264 | 268 |
| 265 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ | 269 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_PROFILE_H_ |
| OLD | NEW |