| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 return AutofillDialogControllerImpl::Create(contents, | 415 return AutofillDialogControllerImpl::Create(contents, |
| 416 form_structure, | 416 form_structure, |
| 417 source_url, | 417 source_url, |
| 418 callback); | 418 callback); |
| 419 } | 419 } |
| 420 | 420 |
| 421 void AutofillDialogControllerImpl::Show() { | 421 void AutofillDialogControllerImpl::Show() { |
| 422 dialog_shown_timestamp_ = base::Time::Now(); | 422 dialog_shown_timestamp_ = base::Time::Now(); |
| 423 | 423 |
| 424 // Determine what field types should be included in the dialog. | 424 // Determine what field types should be included in the dialog. |
| 425 bool has_types = false; | 425 form_structure_.ParseFieldTypesFromAutocompleteAttributes(); |
| 426 bool has_sections = false; | |
| 427 form_structure_.ParseFieldTypesFromAutocompleteAttributes( | |
| 428 &has_types, &has_sections); | |
| 429 | 426 |
| 430 // Fail if the author didn't specify autocomplete types. | 427 // Fail if the author didn't specify autocomplete types. |
| 431 if (!has_types) { | 428 if (!form_structure_.has_author_specified_types()) { |
| 432 callback_.Run( | 429 callback_.Run( |
| 433 AutofillClient::AutocompleteResultErrorDisabled, | 430 AutofillClient::AutocompleteResultErrorDisabled, |
| 434 base::ASCIIToUTF16("Form is missing autocomplete attributes."), | 431 base::ASCIIToUTF16("Form is missing autocomplete attributes."), |
| 435 NULL); | 432 NULL); |
| 436 delete this; | 433 delete this; |
| 437 return; | 434 return; |
| 438 } | 435 } |
| 439 | 436 |
| 440 // Fail if the author didn't ask for at least some kind of credit card | 437 // Fail if the author didn't ask for at least some kind of credit card |
| 441 // information. | 438 // information. |
| (...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2309 } | 2306 } |
| 2310 | 2307 |
| 2311 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { | 2308 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { |
| 2312 if (!view_) | 2309 if (!view_) |
| 2313 return; | 2310 return; |
| 2314 ScopedViewUpdates updates(view_.get()); | 2311 ScopedViewUpdates updates(view_.get()); |
| 2315 view_->UpdateButtonStrip(); | 2312 view_->UpdateButtonStrip(); |
| 2316 } | 2313 } |
| 2317 | 2314 |
| 2318 } // namespace autofill | 2315 } // namespace autofill |
| OLD | NEW |