OLD | NEW |
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 "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 } | 348 } |
349 | 349 |
350 FullWalletShippingWrapper::~FullWalletShippingWrapper() {} | 350 FullWalletShippingWrapper::~FullWalletShippingWrapper() {} |
351 | 351 |
352 base::string16 FullWalletShippingWrapper::GetInfo( | 352 base::string16 FullWalletShippingWrapper::GetInfo( |
353 const AutofillType& type) const { | 353 const AutofillType& type) const { |
354 return full_wallet_->shipping_address()->GetInfo( | 354 return full_wallet_->shipping_address()->GetInfo( |
355 type, g_browser_process->GetApplicationLocale()); | 355 type, g_browser_process->GetApplicationLocale()); |
356 } | 356 } |
357 | 357 |
358 DetailOutputWrapper::DetailOutputWrapper(const DetailOutputMap& outputs) | 358 FieldMapWrapper::FieldMapWrapper(const FieldValueMap& field_map) |
359 : outputs_(outputs) {} | 359 : field_map_(field_map) {} |
360 | 360 |
361 DetailOutputWrapper::~DetailOutputWrapper() {} | 361 FieldMapWrapper::~FieldMapWrapper() {} |
362 | 362 |
363 base::string16 DetailOutputWrapper::GetInfo(const AutofillType& type) const { | 363 base::string16 FieldMapWrapper::GetInfo(const AutofillType& type) const { |
364 for (DetailOutputMap::const_iterator it = outputs_.begin(); | 364 FieldValueMap::const_iterator it = field_map_.find(type.server_type()); |
365 it != outputs_.end(); ++it) { | 365 return it != field_map_.end() ? it->second : base::string16(); |
366 if (type.server_type() == it->first->type) | |
367 return it->second; | |
368 } | |
369 return base::string16(); | |
370 } | 366 } |
371 | 367 |
372 } // namespace autofill | 368 } // namespace autofill |
OLD | NEW |