Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: components/autofill/core/browser/address_i18n.h

Issue 1859453002: components/autofill: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_ADDRESS_I18N_H_ 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_I18N_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_I18N_H_ 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_I18N_H_
7 7
8 #include <memory>
9
8 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
11 #include "components/autofill/core/browser/field_types.h" 12 #include "components/autofill/core/browser/field_types.h"
12 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fi eld.h" 13 #include "third_party/libaddressinput/src/cpp/include/libaddressinput/address_fi eld.h"
13 14
14 namespace i18n { 15 namespace i18n {
15 namespace addressinput { 16 namespace addressinput {
16 struct AddressData; 17 struct AddressData;
17 } 18 }
18 } 19 }
19 20
20 namespace autofill { 21 namespace autofill {
21 22
22 class AutofillProfile; 23 class AutofillProfile;
23 class AutofillType; 24 class AutofillType;
24 25
25 namespace i18n { 26 namespace i18n {
26 27
27 // Creates an AddressData object for internationalized address display or 28 // Creates an AddressData object for internationalized address display or
28 // validation using |get_info| for field values. 29 // validation using |get_info| for field values.
29 scoped_ptr< ::i18n::addressinput::AddressData> CreateAddressData( 30 std::unique_ptr<::i18n::addressinput::AddressData> CreateAddressData(
30 const base::Callback<base::string16(const AutofillType&)>& get_info); 31 const base::Callback<base::string16(const AutofillType&)>& get_info);
31 32
32 // Creates an |AddressData| from |profile|. 33 // Creates an |AddressData| from |profile|.
33 scoped_ptr< ::i18n::addressinput::AddressData> 34 std::unique_ptr<::i18n::addressinput::AddressData>
34 CreateAddressDataFromAutofillProfile(const AutofillProfile& profile, 35 CreateAddressDataFromAutofillProfile(const AutofillProfile& profile,
35 const std::string& app_locale); 36 const std::string& app_locale);
36 37
37 // Returns the corresponding Autofill server type for |field|. 38 // Returns the corresponding Autofill server type for |field|.
38 ServerFieldType TypeForField(::i18n::addressinput::AddressField field, 39 ServerFieldType TypeForField(::i18n::addressinput::AddressField field,
39 bool billing); 40 bool billing);
40 41
41 // Sets |field| to the corresponding address field for the Autofill 42 // Sets |field| to the corresponding address field for the Autofill
42 // |server_type|. Returns |true| if |server_type| can be represented as an 43 // |server_type|. Returns |true| if |server_type| can be represented as an
43 // address field. The |field| parameter can be NULL. 44 // address field. The |field| parameter can be NULL.
44 bool FieldForType(ServerFieldType server_type, 45 bool FieldForType(ServerFieldType server_type,
45 ::i18n::addressinput::AddressField* field); 46 ::i18n::addressinput::AddressField* field);
46 47
47 } // namespace i18n 48 } // namespace i18n
48 } // namespace autofill 49 } // namespace autofill
49 50
50 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_I18N_H_ 51 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_ADDRESS_I18N_H_
OLDNEW
« no previous file with comments | « components/autofill/core/browser/address_field_unittest.cc ('k') | components/autofill/core/browser/address_i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698