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

Side by Side Diff: chrome/browser/ui/android/autofill/autofill_dialog_controller_android.cc

Issue 63053003: Ask libaddressinput for address components to use in requestAutocomplete(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests Created 7 years 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 | Annotate | Revision Log
OLDNEW
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/android/autofill/autofill_dialog_controller_android. h" 5 #include "chrome/browser/ui/android/autofill/autofill_dialog_controller_android. h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (wrapper) 85 if (wrapper)
86 wrapper->FillFormStructure(inputs, compare, &form_structure); 86 wrapper->FillFormStructure(inputs, compare, &form_structure);
87 } 87 }
88 88
89 void FillOutputForSection( 89 void FillOutputForSection(
90 DialogSection section, 90 DialogSection section,
91 FormStructure& form_structure, 91 FormStructure& form_structure,
92 wallet::FullWallet* full_wallet, 92 wallet::FullWallet* full_wallet,
93 const base::string16& email_address) { 93 const base::string16& email_address) {
94 DetailInputs inputs; 94 DetailInputs inputs;
95 common::BuildInputsForSection(section, &inputs); 95 common::BuildInputsForSection(section, &inputs, "US");
96 96
97 FillOutputForSectionWithComparator( 97 FillOutputForSectionWithComparator(
98 section, inputs, 98 section, inputs,
99 base::Bind(common::DetailInputMatchesField, section), 99 base::Bind(common::DetailInputMatchesField, section),
100 form_structure, full_wallet, email_address); 100 form_structure, full_wallet, email_address);
101 101
102 if (section == SECTION_CC_BILLING) { 102 if (section == SECTION_CC_BILLING) {
103 // Email is hidden while using Wallet, special case it. 103 // Email is hidden while using Wallet, special case it.
104 for (size_t i = 0; i < form_structure.field_count(); ++i) { 104 for (size_t i = 0; i < form_structure.field_count(); ++i) {
105 AutofillField* field = form_structure.field(i); 105 AutofillField* field = form_structure.field(i);
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 PHONE_BILLING_WHOLE_NUMBER, 250 PHONE_BILLING_WHOLE_NUMBER,
251 form_structure_) || 251 form_structure_) ||
252 IsSectionInputUsedInFormStructure( 252 IsSectionInputUsedInFormStructure(
253 SECTION_SHIPPING, 253 SECTION_SHIPPING,
254 PHONE_HOME_WHOLE_NUMBER, 254 PHONE_HOME_WHOLE_NUMBER,
255 form_structure_); 255 form_structure_);
256 256
257 bool request_shipping_address = false; 257 bool request_shipping_address = false;
258 { 258 {
259 DetailInputs inputs; 259 DetailInputs inputs;
260 common::BuildInputsForSection(SECTION_SHIPPING, &inputs); 260 common::BuildInputsForSection(SECTION_SHIPPING, &inputs, "US");
261 EmptyDataModelWrapper empty_wrapper; 261 EmptyDataModelWrapper empty_wrapper;
262 request_shipping_address = empty_wrapper.FillFormStructure( 262 request_shipping_address = empty_wrapper.FillFormStructure(
263 inputs, 263 inputs,
264 base::Bind(common::DetailInputMatchesField, SECTION_SHIPPING), 264 base::Bind(common::DetailInputMatchesField, SECTION_SHIPPING),
265 &form_structure_); 265 &form_structure_);
266 } 266 }
267 267
268 const bool incognito_mode = profile_->IsOffTheRecord(); 268 const bool incognito_mode = profile_->IsOffTheRecord();
269 269
270 bool last_used_choice_is_autofill = false; 270 bool last_used_choice_is_autofill = false;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 void AutofillDialogControllerAndroid::LogOnCancelMetrics() { 440 void AutofillDialogControllerAndroid::LogOnCancelMetrics() {
441 GetMetricLogger().LogDialogUiDuration( 441 GetMetricLogger().LogDialogUiDuration(
442 base::Time::Now() - dialog_shown_timestamp_, 442 base::Time::Now() - dialog_shown_timestamp_,
443 AutofillMetrics::DIALOG_CANCELED); 443 AutofillMetrics::DIALOG_CANCELED);
444 444
445 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED); 445 GetMetricLogger().LogDialogUiEvent(AutofillMetrics::DIALOG_UI_CANCELED);
446 } 446 }
447 447
448 } // namespace autofill 448 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/DEPS » ('j') | chrome/browser/ui/autofill/autofill_dialog_common.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698