Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| index 188f72c2ed56d1f8e52fccd8a70cb138e15ff676..e1123e3ef958e99ed5bcfbfd906c1e3d40be3efb 100644 |
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc |
| @@ -596,7 +596,7 @@ base::WeakPtr<AutofillDialogControllerImpl> |
| content::WebContents* contents, |
| const FormData& form_structure, |
| const GURL& source_url, |
| - const base::Callback<void(const FormStructure*)>& callback) { |
| + const AutofillManagerDelegate::ResultCallback& callback) { |
| // AutofillDialogControllerImpl owns itself. |
| AutofillDialogControllerImpl* autofill_dialog_controller = |
| new AutofillDialogControllerImpl(contents, |
| @@ -636,7 +636,7 @@ base::WeakPtr<AutofillDialogController> AutofillDialogController::Create( |
| content::WebContents* contents, |
| const FormData& form_structure, |
| const GURL& source_url, |
| - const base::Callback<void(const FormStructure*)>& callback) { |
| + const AutofillManagerDelegate::ResultCallback& callback) { |
| return AutofillDialogControllerImpl::Create(contents, |
| form_structure, |
| source_url, |
| @@ -654,7 +654,8 @@ void AutofillDialogControllerImpl::Show() { |
| // Fail if the author didn't specify autocomplete types. |
| if (!has_types) { |
| - callback_.Run(NULL); |
| + callback_.Run(AutofillManagerDelegate::AutocompleteResultErrorUnsupported, |
| + NULL); |
|
Dan Beam
2014/04/09 23:21:47
actually, can you add a unit test for this case?
Evan Stade
2014/04/10 00:59:37
https://codereview.chromium.org/232353003/
|
| delete this; |
| return; |
| } |
| @@ -2179,7 +2180,7 @@ bool AutofillDialogControllerImpl::OnCancel() { |
| HidePopup(); |
| if (!is_submitting_) |
| LogOnCancelMetrics(); |
| - callback_.Run(NULL); |
| + callback_.Run(AutofillManagerDelegate::AutocompleteResultErrorCancel, NULL); |
| return true; |
| } |
| @@ -2675,7 +2676,7 @@ AutofillDialogControllerImpl::AutofillDialogControllerImpl( |
| content::WebContents* contents, |
| const FormData& form_structure, |
| const GURL& source_url, |
| - const base::Callback<void(const FormStructure*)>& callback) |
| + const AutofillManagerDelegate::ResultCallback& callback) |
| : WebContentsObserver(contents), |
| profile_(Profile::FromBrowserContext(contents->GetBrowserContext())), |
| initial_user_state_(AutofillMetrics::DIALOG_USER_STATE_UNKNOWN), |
| @@ -3750,7 +3751,8 @@ void AutofillDialogControllerImpl::DoFinishSubmit() { |
| LogOnFinishSubmitMetrics(); |
| // Callback should be called as late as possible. |
| - callback_.Run(&form_structure_); |
| + callback_.Run(AutofillManagerDelegate::AutocompleteResultSuccess, |
| + &form_structure_); |
| data_was_passed_back_ = true; |
| // This might delete us. |