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

Side by Side Diff: chrome/browser/ui/autofill/data_model_wrapper.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/autofill/data_model_wrapper.h" 5 #include "chrome/browser/ui/autofill/data_model_wrapper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 bool DataModelWrapper::GetDisplayText( 50 bool DataModelWrapper::GetDisplayText(
51 base::string16* vertically_compact, 51 base::string16* vertically_compact,
52 base::string16* horizontally_compact) { 52 base::string16* horizontally_compact) {
53 base::string16 phone = 53 base::string16 phone =
54 GetInfoForDisplay(AutofillType(PHONE_HOME_WHOLE_NUMBER)); 54 GetInfoForDisplay(AutofillType(PHONE_HOME_WHOLE_NUMBER));
55 if (phone.empty()) 55 if (phone.empty())
56 return false; 56 return false;
57 57
58 // Format the address. 58 // Format the address.
59 scoped_ptr< ::i18n::addressinput::AddressData> address_data = 59 std::unique_ptr<::i18n::addressinput::AddressData> address_data =
60 i18n::CreateAddressData( 60 i18n::CreateAddressData(
61 base::Bind(&DataModelWrapper::GetInfo, base::Unretained(this))); 61 base::Bind(&DataModelWrapper::GetInfo, base::Unretained(this)));
62 address_data->language_code = GetLanguageCode(); 62 address_data->language_code = GetLanguageCode();
63 // Interactive autofill dialog does not display organization field. 63 // Interactive autofill dialog does not display organization field.
64 address_data->organization.clear(); 64 address_data->organization.clear();
65 std::vector<std::string> lines; 65 std::vector<std::string> lines;
66 ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines); 66 ::i18n::addressinput::GetFormattedNationalAddress(*address_data, &lines);
67 67
68 std::string single_line; 68 std::string single_line;
69 ::i18n::addressinput::GetFormattedNationalAddressLine( 69 ::i18n::addressinput::GetFormattedNationalAddressLine(
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 return base::UTF8ToUTF16(address_->GetFieldValue(field)); 225 return base::UTF8ToUTF16(address_->GetFieldValue(field));
226 } 226 }
227 227
228 const std::string& I18nAddressDataWrapper::GetLanguageCode() const { 228 const std::string& I18nAddressDataWrapper::GetLanguageCode() const {
229 return address_->language_code; 229 return address_->language_code;
230 } 230 }
231 231
232 } // namespace autofill 232 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/credit_card_scanner_view.cc ('k') | chrome/browser/ui/autofill/data_model_wrapper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698