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

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

Issue 1583563003: [Autofill] Parse forms that have autocomplete attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 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 #include <utility> 10 #include <utility>
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 NULL); 434 NULL);
435 delete this; 435 delete this;
436 return; 436 return;
437 } 437 }
438 438
439 // Fail if the author didn't ask for at least some kind of credit card 439 // Fail if the author didn't ask for at least some kind of credit card
440 // information. 440 // information.
441 bool has_credit_card_field = false; 441 bool has_credit_card_field = false;
442 for (size_t i = 0; i < form_structure_.field_count(); ++i) { 442 for (size_t i = 0; i < form_structure_.field_count(); ++i) {
443 AutofillType type = form_structure_.field(i)->Type(); 443 AutofillType type = form_structure_.field(i)->Type();
444 if (type.html_type() != HTML_TYPE_UNKNOWN && type.group() == CREDIT_CARD) { 444 if (type.html_type() != HTML_TYPE_UNSPECIFIED &&
445 type.group() == CREDIT_CARD) {
445 has_credit_card_field = true; 446 has_credit_card_field = true;
446 break; 447 break;
447 } 448 }
448 } 449 }
449 450
450 if (!has_credit_card_field) { 451 if (!has_credit_card_field) {
451 callback_.Run(AutofillClient::AutocompleteResultErrorDisabled, 452 callback_.Run(AutofillClient::AutocompleteResultErrorDisabled,
452 base::ASCIIToUTF16( 453 base::ASCIIToUTF16(
453 "Form is not a payment form (must contain " 454 "Form is not a payment form (must contain "
454 "some autocomplete=\"cc-*\" fields). "), 455 "some autocomplete=\"cc-*\" fields). "),
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 } 2309 }
2309 2310
2310 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { 2311 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() {
2311 if (!view_) 2312 if (!view_)
2312 return; 2313 return;
2313 ScopedViewUpdates updates(view_.get()); 2314 ScopedViewUpdates updates(view_.get());
2314 view_->UpdateButtonStrip(); 2315 view_->UpdateButtonStrip();
2315 } 2316 }
2316 2317
2317 } // namespace autofill 2318 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | components/autofill/core/browser/autofill_field.cc » ('j') | components/autofill/core/browser/form_structure.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698