| 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 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |     5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 
|     6  |     6  | 
|     7 #include <algorithm> |     7 #include <algorithm> | 
|     8 #include <map> |     8 #include <map> | 
|     9 #include <string> |     9 #include <string> | 
|    10  |    10  | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|    47 #include "components/autofill/content/browser/wallet/instrument.h" |    47 #include "components/autofill/content/browser/wallet/instrument.h" | 
|    48 #include "components/autofill/content/browser/wallet/wallet_address.h" |    48 #include "components/autofill/content/browser/wallet/wallet_address.h" | 
|    49 #include "components/autofill/content/browser/wallet/wallet_items.h" |    49 #include "components/autofill/content/browser/wallet/wallet_items.h" | 
|    50 #include "components/autofill/content/browser/wallet/wallet_service_url.h" |    50 #include "components/autofill/content/browser/wallet/wallet_service_url.h" | 
|    51 #include "components/autofill/content/browser/wallet/wallet_signin_helper.h" |    51 #include "components/autofill/content/browser/wallet/wallet_signin_helper.h" | 
|    52 #include "components/autofill/core/browser/address_i18n.h" |    52 #include "components/autofill/core/browser/address_i18n.h" | 
|    53 #include "components/autofill/core/browser/autofill_country.h" |    53 #include "components/autofill/core/browser/autofill_country.h" | 
|    54 #include "components/autofill/core/browser/autofill_data_model.h" |    54 #include "components/autofill/core/browser/autofill_data_model.h" | 
|    55 #include "components/autofill/core/browser/autofill_manager.h" |    55 #include "components/autofill/core/browser/autofill_manager.h" | 
|    56 #include "components/autofill/core/browser/autofill_type.h" |    56 #include "components/autofill/core/browser/autofill_type.h" | 
 |    57 #include "components/autofill/core/browser/detail_input.h" | 
 |    58 #include "components/autofill/core/browser/field_types.h" | 
|    57 #include "components/autofill/core/browser/personal_data_manager.h" |    59 #include "components/autofill/core/browser/personal_data_manager.h" | 
|    58 #include "components/autofill/core/browser/phone_number_i18n.h" |    60 #include "components/autofill/core/browser/phone_number_i18n.h" | 
 |    61 #include "components/autofill/core/browser/server_field_types_util.h" | 
|    59 #include "components/autofill/core/browser/validation.h" |    62 #include "components/autofill/core/browser/validation.h" | 
|    60 #include "components/autofill/core/common/autofill_pref_names.h" |    63 #include "components/autofill/core/common/autofill_pref_names.h" | 
|    61 #include "components/autofill/core/common/form_data.h" |    64 #include "components/autofill/core/common/form_data.h" | 
|    62 #include "components/pref_registry/pref_registry_syncable.h" |    65 #include "components/pref_registry/pref_registry_syncable.h" | 
|    63 #include "content/public/browser/browser_thread.h" |    66 #include "content/public/browser/browser_thread.h" | 
|    64 #include "content/public/browser/geolocation_provider.h" |    67 #include "content/public/browser/geolocation_provider.h" | 
|    65 #include "content/public/browser/navigation_controller.h" |    68 #include "content/public/browser/navigation_controller.h" | 
|    66 #include "content/public/browser/navigation_details.h" |    69 #include "content/public/browser/navigation_details.h" | 
|    67 #include "content/public/browser/navigation_entry.h" |    70 #include "content/public/browser/navigation_entry.h" | 
|    68 #include "content/public/browser/notification_service.h" |    71 #include "content/public/browser/notification_service.h" | 
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   178   return info; |   181   return info; | 
|   179 } |   182 } | 
|   180  |   183  | 
|   181 // Returns true if |input| should be used to fill a site-requested |field| which |   184 // Returns true if |input| should be used to fill a site-requested |field| which | 
|   182 // is notated with a "shipping" tag, for use when the user has decided to use |   185 // is notated with a "shipping" tag, for use when the user has decided to use | 
|   183 // the billing address as the shipping address. |   186 // the billing address as the shipping address. | 
|   184 bool ServerTypeMatchesShippingField(ServerFieldType type, |   187 bool ServerTypeMatchesShippingField(ServerFieldType type, | 
|   185                                     const AutofillField& field) { |   188                                     const AutofillField& field) { | 
|   186   // Equivalent billing field type is used to support UseBillingAsShipping |   189   // Equivalent billing field type is used to support UseBillingAsShipping | 
|   187   // usecase. |   190   // usecase. | 
|   188   return common::ServerTypeEncompassesFieldType( |   191   return ServerTypeEncompassesFieldType( | 
|   189       type, |   192       type, AutofillType(AutofillType::GetEquivalentBillingFieldType( | 
|   190       AutofillType(AutofillType::GetEquivalentBillingFieldType( |   193                 field.Type().GetStorableType()))); | 
|   191           field.Type().GetStorableType()))); |  | 
|   192 } |   194 } | 
|   193  |   195  | 
|   194 // Initializes |form_group| from user-entered data. |   196 // Initializes |form_group| from user-entered data. | 
|   195 void FillFormGroupFromOutputs(const FieldValueMap& detail_outputs, |   197 void FillFormGroupFromOutputs(const FieldValueMap& detail_outputs, | 
|   196                               FormGroup* form_group) { |   198                               FormGroup* form_group) { | 
|   197   for (FieldValueMap::const_iterator iter = detail_outputs.begin(); |   199   for (FieldValueMap::const_iterator iter = detail_outputs.begin(); | 
|   198        iter != detail_outputs.end(); ++iter) { |   200        iter != detail_outputs.end(); ++iter) { | 
|   199     ServerFieldType type = iter->first; |   201     ServerFieldType type = iter->first; | 
|   200     if (!iter->second.empty()) { |   202     if (!iter->second.empty()) { | 
|   201       form_group->SetInfo(AutofillType(type), |   203       form_group->SetInfo(AutofillType(type), | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
|   215   for (FieldValueMap::const_iterator it = output.begin(); |   217   for (FieldValueMap::const_iterator it = output.begin(); | 
|   216        it != output.end(); ++it) { |   218        it != output.end(); ++it) { | 
|   217     const ServerFieldType type = it->first; |   219     const ServerFieldType type = it->first; | 
|   218     base::string16 trimmed; |   220     base::string16 trimmed; | 
|   219     base::TrimWhitespace(it->second, base::TRIM_ALL, &trimmed); |   221     base::TrimWhitespace(it->second, base::TRIM_ALL, &trimmed); | 
|   220  |   222  | 
|   221     // Special case CVC as CreditCard just swallows it. |   223     // Special case CVC as CreditCard just swallows it. | 
|   222     if (type == CREDIT_CARD_VERIFICATION_CODE) { |   224     if (type == CREDIT_CARD_VERIFICATION_CODE) { | 
|   223       if (cvc) |   225       if (cvc) | 
|   224         cvc->assign(trimmed); |   226         cvc->assign(trimmed); | 
|   225     } else if (common::IsCreditCardType(type)) { |   227     } else if (IsCreditCardType(type)) { | 
|   226       card->SetRawInfo(type, trimmed); |   228       card->SetRawInfo(type, trimmed); | 
|   227     } else { |   229     } else { | 
|   228       // Copy the credit card name to |profile| in addition to |card| as |   230       // Copy the credit card name to |profile| in addition to |card| as | 
|   229       // wallet::Instrument requires a recipient name for its billing address. |   231       // wallet::Instrument requires a recipient name for its billing address. | 
|   230       if (card && type == NAME_FULL) |   232       if (card && type == NAME_FULL) | 
|   231         card->SetRawInfo(CREDIT_CARD_NAME, trimmed); |   233         card->SetRawInfo(CREDIT_CARD_NAME, trimmed); | 
|   232  |   234  | 
|   233       if (profile) { |   235       if (profile) { | 
|   234         profile->SetInfo(AutofillType(AutofillType(type).GetStorableType()), |   236         profile->SetInfo(AutofillType(AutofillType(type).GetStorableType()), | 
|   235                          trimmed, |   237                          trimmed, | 
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   567   }; |   569   }; | 
|   568  |   570  | 
|   569   const DetailInput kShippingPhoneInputs[] = { |   571   const DetailInput kShippingPhoneInputs[] = { | 
|   570     { DetailInput::LONG, |   572     { DetailInput::LONG, | 
|   571       PHONE_HOME_WHOLE_NUMBER, |   573       PHONE_HOME_WHOLE_NUMBER, | 
|   572       GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_PHONE_NUMBER) }, |   574       GetStringUTF16(IDS_AUTOFILL_DIALOG_PLACEHOLDER_PHONE_NUMBER) }, | 
|   573   }; |   575   }; | 
|   574  |   576  | 
|   575   switch (dialog_section) { |   577   switch (dialog_section) { | 
|   576     case SECTION_CC: { |   578     case SECTION_CC: { | 
|   577       common::BuildInputs(kCCInputs, arraysize(kCCInputs), inputs); |   579       BuildInputs(kCCInputs, arraysize(kCCInputs), inputs); | 
|   578       break; |   580       break; | 
|   579     } |   581     } | 
|   580  |   582  | 
|   581     case SECTION_BILLING: { |   583     case SECTION_BILLING: { | 
|   582       i18ninput::BuildAddressInputs(common::ADDRESS_TYPE_BILLING, |   584       i18ninput::BuildAddressInputs(common::ADDRESS_TYPE_BILLING, | 
|   583                                     country_code, inputs, language_code); |   585                                     country_code, inputs, language_code); | 
|   584       common::BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), |   586       BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), inputs); | 
|   585                           inputs); |   587       BuildInputs(kEmailInputs, arraysize(kEmailInputs), inputs); | 
|   586       common::BuildInputs(kEmailInputs, arraysize(kEmailInputs), inputs); |  | 
|   587       break; |   588       break; | 
|   588     } |   589     } | 
|   589  |   590  | 
|   590     case SECTION_CC_BILLING: { |   591     case SECTION_CC_BILLING: { | 
|   591       common::BuildInputs(kCCInputs, arraysize(kCCInputs), inputs); |   592       BuildInputs(kCCInputs, arraysize(kCCInputs), inputs); | 
|   592  |   593  | 
|   593       // Wallet only supports US billing addresses. |   594       // Wallet only supports US billing addresses. | 
|   594       const std::string hardcoded_country_code = "US"; |   595       const std::string hardcoded_country_code = "US"; | 
|   595       i18ninput::BuildAddressInputs(common::ADDRESS_TYPE_BILLING, |   596       i18ninput::BuildAddressInputs(common::ADDRESS_TYPE_BILLING, | 
|   596                                     hardcoded_country_code, |   597                                     hardcoded_country_code, | 
|   597                                     inputs, |   598                                     inputs, | 
|   598                                     language_code); |   599                                     language_code); | 
|   599       DCHECK_EQ(inputs->back().type, ADDRESS_BILLING_COUNTRY); |   600       DCHECK_EQ(inputs->back().type, ADDRESS_BILLING_COUNTRY); | 
|   600       inputs->back().length = DetailInput::NONE; |   601       inputs->back().length = DetailInput::NONE; | 
|   601       const std::string& app_locale = |   602       const std::string& app_locale = | 
|   602           g_browser_process->GetApplicationLocale(); |   603           g_browser_process->GetApplicationLocale(); | 
|   603       inputs->back().initial_value = |   604       inputs->back().initial_value = | 
|   604           AutofillCountry(hardcoded_country_code, app_locale).name(); |   605           AutofillCountry(hardcoded_country_code, app_locale).name(); | 
|   605  |   606  | 
|   606       common::BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), |   607       BuildInputs(kBillingPhoneInputs, arraysize(kBillingPhoneInputs), inputs); | 
|   607                           inputs); |  | 
|   608       break; |   608       break; | 
|   609     } |   609     } | 
|   610  |   610  | 
|   611     case SECTION_SHIPPING: { |   611     case SECTION_SHIPPING: { | 
|   612       i18ninput::BuildAddressInputs(common::ADDRESS_TYPE_SHIPPING, |   612       i18ninput::BuildAddressInputs(common::ADDRESS_TYPE_SHIPPING, | 
|   613                                     country_code, inputs, language_code); |   613                                     country_code, inputs, language_code); | 
|   614       common::BuildInputs(kShippingPhoneInputs, arraysize(kShippingPhoneInputs), |   614       BuildInputs(kShippingPhoneInputs, arraysize(kShippingPhoneInputs), | 
|   615                           inputs); |   615                   inputs); | 
|   616       break; |   616       break; | 
|   617     } |   617     } | 
|   618   } |   618   } | 
|   619 } |   619 } | 
|   620  |   620  | 
|   621 }  // namespace |   621 }  // namespace | 
|   622  |   622  | 
|   623 AutofillDialogViewDelegate::~AutofillDialogViewDelegate() {} |   623 AutofillDialogViewDelegate::~AutofillDialogViewDelegate() {} | 
|   624  |   624  | 
|   625 AutofillDialogControllerImpl::~AutofillDialogControllerImpl() { |   625 AutofillDialogControllerImpl::~AutofillDialogControllerImpl() { | 
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   805     DetailInputs* inputs = MutableRequestedFieldsForSection(section); |   805     DetailInputs* inputs = MutableRequestedFieldsForSection(section); | 
|   806     BuildInputsForSection( |   806     BuildInputsForSection( | 
|   807         section, country_code, inputs, |   807         section, country_code, inputs, | 
|   808         MutableAddressLanguageCodeForSection(section)); |   808         MutableAddressLanguageCodeForSection(section)); | 
|   809   } |   809   } | 
|   810  |   810  | 
|   811   // Test whether we need to show the shipping section. If filling that section |   811   // Test whether we need to show the shipping section. If filling that section | 
|   812   // would be a no-op, don't show it. |   812   // would be a no-op, don't show it. | 
|   813   cares_about_shipping_ = form_structure_.FillFields( |   813   cares_about_shipping_ = form_structure_.FillFields( | 
|   814       RequestedTypesForSection(SECTION_SHIPPING), |   814       RequestedTypesForSection(SECTION_SHIPPING), | 
|   815       base::Bind(common::ServerTypeMatchesField, SECTION_SHIPPING), |   815       base::Bind(ServerTypeMatchesField, SECTION_SHIPPING), | 
|   816       base::Bind(NullGetInfo), |   816       base::Bind(NullGetInfo), std::string(), | 
|   817       std::string(), |  | 
|   818       g_browser_process->GetApplicationLocale()); |   817       g_browser_process->GetApplicationLocale()); | 
|   819  |   818  | 
|   820   transaction_amount_ = form_structure_.GetUniqueValue( |   819   transaction_amount_ = form_structure_.GetUniqueValue( | 
|   821       HTML_TYPE_TRANSACTION_AMOUNT); |   820       HTML_TYPE_TRANSACTION_AMOUNT); | 
|   822   transaction_currency_ = form_structure_.GetUniqueValue( |   821   transaction_currency_ = form_structure_.GetUniqueValue( | 
|   823       HTML_TYPE_TRANSACTION_CURRENCY); |   822       HTML_TYPE_TRANSACTION_CURRENCY); | 
|   824  |   823  | 
|   825   account_chooser_model_.reset( |   824   account_chooser_model_.reset( | 
|   826       new AccountChooserModel(this, profile_, !ShouldShowAccountChooser())); |   825       new AccountChooserModel(this, profile_, !ShouldShowAccountChooser())); | 
|   827  |   826  | 
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2096  |  2095  | 
|  2097   // If the user clicks while the popup is already showing, be sure to hide |  2096   // If the user clicks while the popup is already showing, be sure to hide | 
|  2098   // it. |  2097   // it. | 
|  2099   if (!was_edit && popup_controller_.get()) { |  2098   if (!was_edit && popup_controller_.get()) { | 
|  2100     HidePopup(); |  2099     HidePopup(); | 
|  2101     return; |  2100     return; | 
|  2102   } |  2101   } | 
|  2103  |  2102  | 
|  2104   std::vector<autofill::Suggestion> popup_suggestions; |  2103   std::vector<autofill::Suggestion> popup_suggestions; | 
|  2105   popup_suggestion_ids_.clear(); |  2104   popup_suggestion_ids_.clear(); | 
|  2106   if (common::IsCreditCardType(type)) { |  2105   if (IsCreditCardType(type)) { | 
|  2107     popup_suggestions = GetManager()->GetCreditCardSuggestions( |  2106     popup_suggestions = GetManager()->GetCreditCardSuggestions( | 
|  2108         AutofillType(type), field_contents); |  2107         AutofillType(type), field_contents); | 
|  2109     for (const auto& suggestion : popup_suggestions) |  2108     for (const auto& suggestion : popup_suggestions) | 
|  2110       popup_suggestion_ids_.push_back(suggestion.backend_id); |  2109       popup_suggestion_ids_.push_back(suggestion.backend_id); | 
|  2111   } else { |  2110   } else { | 
|  2112     popup_suggestions = GetManager()->GetProfileSuggestions( |  2111     popup_suggestions = GetManager()->GetProfileSuggestions( | 
|  2113         AutofillType(type), |  2112         AutofillType(type), | 
|  2114         field_contents, |  2113         field_contents, | 
|  2115         false, |  2114         false, | 
|  2116         RequestedTypesForSection(section)); |  2115         RequestedTypesForSection(section)); | 
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  2385   DCHECK_NE(UNKNOWN_TYPE, popup_input_type_); |  2384   DCHECK_NE(UNKNOWN_TYPE, popup_input_type_); | 
|  2386   // Because |HidePopup()| can be called from |UpdateSection()|, remember the |  2385   // Because |HidePopup()| can be called from |UpdateSection()|, remember the | 
|  2387   // type of the input for later here. |  2386   // type of the input for later here. | 
|  2388   const ServerFieldType popup_input_type = popup_input_type_; |  2387   const ServerFieldType popup_input_type = popup_input_type_; | 
|  2389  |  2388  | 
|  2390   ScopedViewUpdates updates(view_.get()); |  2389   ScopedViewUpdates updates(view_.get()); | 
|  2391   scoped_ptr<DataModelWrapper> wrapper; |  2390   scoped_ptr<DataModelWrapper> wrapper; | 
|  2392  |  2391  | 
|  2393   if (static_cast<size_t>(identifier) < popup_suggestion_ids_.size()) { |  2392   if (static_cast<size_t>(identifier) < popup_suggestion_ids_.size()) { | 
|  2394     const SuggestionBackendID& sid = popup_suggestion_ids_[identifier]; |  2393     const SuggestionBackendID& sid = popup_suggestion_ids_[identifier]; | 
|  2395     if (common::IsCreditCardType(popup_input_type)) { |  2394     if (IsCreditCardType(popup_input_type)) { | 
|  2396       wrapper.reset(new AutofillCreditCardWrapper( |  2395       wrapper.reset(new AutofillCreditCardWrapper( | 
|  2397           GetManager()->GetCreditCardByGUID(sid.guid))); |  2396           GetManager()->GetCreditCardByGUID(sid.guid))); | 
|  2398     } else { |  2397     } else { | 
|  2399       wrapper.reset(new AutofillProfileWrapper( |  2398       wrapper.reset(new AutofillProfileWrapper( | 
|  2400           GetManager()->GetProfileByGUID(sid.guid), |  2399           GetManager()->GetProfileByGUID(sid.guid), | 
|  2401           AutofillType(popup_input_type), |  2400           AutofillType(popup_input_type), | 
|  2402           sid.variant)); |  2401           sid.variant)); | 
|  2403     } |  2402     } | 
|  2404   } else { |  2403   } else { | 
|  2405     wrapper.reset(new I18nAddressDataWrapper( |  2404     wrapper.reset(new I18nAddressDataWrapper( | 
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3157 void AutofillDialogControllerImpl::FillOutputForSectionWithComparator( |  3156 void AutofillDialogControllerImpl::FillOutputForSectionWithComparator( | 
|  3158     DialogSection section, |  3157     DialogSection section, | 
|  3159     const FormStructure::InputFieldComparator& compare) { |  3158     const FormStructure::InputFieldComparator& compare) { | 
|  3160   if (!SectionIsActive(section)) |  3159   if (!SectionIsActive(section)) | 
|  3161     return; |  3160     return; | 
|  3162  |  3161  | 
|  3163   DetailInputs inputs; |  3162   DetailInputs inputs; | 
|  3164   std::string country_code = CountryCodeForSection(section); |  3163   std::string country_code = CountryCodeForSection(section); | 
|  3165   BuildInputsForSection(section, country_code, &inputs, |  3164   BuildInputsForSection(section, country_code, &inputs, | 
|  3166                         MutableAddressLanguageCodeForSection(section)); |  3165                         MutableAddressLanguageCodeForSection(section)); | 
|  3167   std::vector<ServerFieldType> types = common::TypesFromInputs(inputs); |  3166   std::vector<ServerFieldType> types = TypesFromInputs(inputs); | 
|  3168  |  3167  | 
|  3169   scoped_ptr<DataModelWrapper> wrapper = CreateWrapper(section); |  3168   scoped_ptr<DataModelWrapper> wrapper = CreateWrapper(section); | 
|  3170   if (wrapper) { |  3169   if (wrapper) { | 
|  3171     // Only fill in data that is associated with this section. |  3170     // Only fill in data that is associated with this section. | 
|  3172     wrapper->FillFormStructure(types, compare, &form_structure_); |  3171     wrapper->FillFormStructure(types, compare, &form_structure_); | 
|  3173  |  3172  | 
|  3174     // CVC needs special-casing because the CreditCard class doesn't store or |  3173     // CVC needs special-casing because the CreditCard class doesn't store or | 
|  3175     // handle them. This isn't necessary when filling the combined CC and |  3174     // handle them. This isn't necessary when filling the combined CC and | 
|  3176     // billing section as CVC comes from |full_wallet_| in this case. |  3175     // billing section as CVC comes from |full_wallet_| in this case. | 
|  3177     if (section == SECTION_CC) |  3176     if (section == SECTION_CC) | 
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3228       } |  3227       } | 
|  3229  |  3228  | 
|  3230       AutofillProfileWrapper profile_wrapper(&profile); |  3229       AutofillProfileWrapper profile_wrapper(&profile); | 
|  3231       profile_wrapper.FillFormStructure(types, compare, &form_structure_); |  3230       profile_wrapper.FillFormStructure(types, compare, &form_structure_); | 
|  3232     } |  3231     } | 
|  3233   } |  3232   } | 
|  3234 } |  3233 } | 
|  3235  |  3234  | 
|  3236 void AutofillDialogControllerImpl::FillOutputForSection(DialogSection section) { |  3235 void AutofillDialogControllerImpl::FillOutputForSection(DialogSection section) { | 
|  3237   FillOutputForSectionWithComparator( |  3236   FillOutputForSectionWithComparator( | 
|  3238       section, base::Bind(common::ServerTypeMatchesField, section)); |  3237       section, base::Bind(ServerTypeMatchesField, section)); | 
|  3239 } |  3238 } | 
|  3240  |  3239  | 
|  3241 bool AutofillDialogControllerImpl::FormStructureCaresAboutSection( |  3240 bool AutofillDialogControllerImpl::FormStructureCaresAboutSection( | 
|  3242     DialogSection section) const { |  3241     DialogSection section) const { | 
|  3243   // For now, only SECTION_SHIPPING may be omitted due to a site not asking for |  3242   // For now, only SECTION_SHIPPING may be omitted due to a site not asking for | 
|  3244   // any of the fields. |  3243   // any of the fields. | 
|  3245   if (section == SECTION_SHIPPING) |  3244   if (section == SECTION_SHIPPING) | 
|  3246     return cares_about_shipping_; |  3245     return cares_about_shipping_; | 
|  3247  |  3246  | 
|  3248   return true; |  3247   return true; | 
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  3415 } |  3414 } | 
|  3416  |  3415  | 
|  3417 std::string AutofillDialogControllerImpl::AddressLanguageCodeForSection( |  3416 std::string AutofillDialogControllerImpl::AddressLanguageCodeForSection( | 
|  3418     DialogSection section) { |  3417     DialogSection section) { | 
|  3419   std::string* language_code = MutableAddressLanguageCodeForSection(section); |  3418   std::string* language_code = MutableAddressLanguageCodeForSection(section); | 
|  3420   return language_code != NULL ? *language_code : std::string(); |  3419   return language_code != NULL ? *language_code : std::string(); | 
|  3421 } |  3420 } | 
|  3422  |  3421  | 
|  3423 std::vector<ServerFieldType> AutofillDialogControllerImpl:: |  3422 std::vector<ServerFieldType> AutofillDialogControllerImpl:: | 
|  3424     RequestedTypesForSection(DialogSection section) const { |  3423     RequestedTypesForSection(DialogSection section) const { | 
|  3425   return common::TypesFromInputs(RequestedFieldsForSection(section)); |  3424   return TypesFromInputs(RequestedFieldsForSection(section)); | 
|  3426 } |  3425 } | 
|  3427  |  3426  | 
|  3428 std::string AutofillDialogControllerImpl::CountryCodeForSection( |  3427 std::string AutofillDialogControllerImpl::CountryCodeForSection( | 
|  3429     DialogSection section) { |  3428     DialogSection section) { | 
|  3430   base::string16 country; |  3429   base::string16 country; | 
|  3431  |  3430  | 
|  3432   scoped_ptr<DataModelWrapper> wrapper = CreateWrapper(section); |  3431   scoped_ptr<DataModelWrapper> wrapper = CreateWrapper(section); | 
|  3433   if (wrapper) { |  3432   if (wrapper) { | 
|  3434     country = wrapper->GetInfo(AutofillType(CountryTypeForSection(section))); |  3433     country = wrapper->GetInfo(AutofillType(CountryTypeForSection(section))); | 
|  3435   } else { |  3434   } else { | 
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  4109   view_->UpdateButtonStrip(); |  4108   view_->UpdateButtonStrip(); | 
|  4110 } |  4109 } | 
|  4111  |  4110  | 
|  4112 void AutofillDialogControllerImpl::FetchWalletCookie() { |  4111 void AutofillDialogControllerImpl::FetchWalletCookie() { | 
|  4113   net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |  4112   net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 
|  4114   signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |  4113   signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 
|  4115   signin_helper_->StartWalletCookieValueFetch(); |  4114   signin_helper_->StartWalletCookieValueFetch(); | 
|  4116 } |  4115 } | 
|  4117  |  4116  | 
|  4118 }  // namespace autofill |  4117 }  // namespace autofill | 
| OLD | NEW |