Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 #include "components/autofill/core/browser/form_structure.h" | 21 #include "components/autofill/core/browser/form_structure.h" |
| 22 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
| 23 #include "ui/gfx/image/image.h" | 23 #include "ui/gfx/image/image.h" |
| 24 | 24 |
| 25 using base::ASCIIToUTF16; | 25 using base::ASCIIToUTF16; |
| 26 | 26 |
| 27 namespace autofill { | 27 namespace autofill { |
| 28 | 28 |
| 29 DataModelWrapper::~DataModelWrapper() {} | 29 DataModelWrapper::~DataModelWrapper() {} |
| 30 | 30 |
| 31 void DataModelWrapper::FillInputs(DetailInputs* inputs) { | 31 void DataModelWrapper::FillInputs(DetailInputs* inputs, |
| 32 const std::string& country_code) { | |
| 32 for (size_t i = 0; i < inputs->size(); ++i) { | 33 for (size_t i = 0; i < inputs->size(); ++i) { |
| 33 DetailInput* input = &(*inputs)[i]; | 34 DetailInput* input = &(*inputs)[i]; |
| 34 input->initial_value = common::GetHardcodedValueForType(input->type); | 35 input->initial_value = common::GetInitialValueForType(input->type, |
|
Evan Stade
2014/01/02 22:59:26
I was hoping we could get rid of this
| |
| 36 country_code); | |
| 35 if (input->initial_value.empty()) | 37 if (input->initial_value.empty()) |
| 36 input->initial_value = GetInfo(AutofillType(input->type)); | 38 input->initial_value = GetInfo(AutofillType(input->type)); |
| 37 } | 39 } |
| 38 } | 40 } |
| 39 | 41 |
| 40 base::string16 DataModelWrapper::GetInfoForDisplay(const AutofillType& type) | 42 base::string16 DataModelWrapper::GetInfoForDisplay(const AutofillType& type) |
| 41 const { | 43 const { |
| 42 return GetInfo(type); | 44 return GetInfo(type); |
| 43 } | 45 } |
| 44 | 46 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 : field_map_(field_map) {} | 363 : field_map_(field_map) {} |
| 362 | 364 |
| 363 FieldMapWrapper::~FieldMapWrapper() {} | 365 FieldMapWrapper::~FieldMapWrapper() {} |
| 364 | 366 |
| 365 base::string16 FieldMapWrapper::GetInfo(const AutofillType& type) const { | 367 base::string16 FieldMapWrapper::GetInfo(const AutofillType& type) const { |
| 366 FieldValueMap::const_iterator it = field_map_.find(type.server_type()); | 368 FieldValueMap::const_iterator it = field_map_.find(type.server_type()); |
| 367 return it != field_map_.end() ? it->second : base::string16(); | 369 return it != field_map_.end() ? it->second : base::string16(); |
| 368 } | 370 } |
| 369 | 371 |
| 370 } // namespace autofill | 372 } // namespace autofill |
| OLD | NEW |