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

Unified Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 229723002: Better error reasons for rAc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
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 71c79c12d91569593ff6e86260f92ea1bc11b9b0..6f7c9c944ac10335f74e250ca5a5996ee18bcc76 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -595,7 +595,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,
@@ -635,7 +635,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,
@@ -653,7 +653,8 @@ void AutofillDialogControllerImpl::Show() {
// Fail if the author didn't specify autocomplete types.
if (!has_types) {
- callback_.Run(NULL);
+ callback_.Run(AutofillManagerDelegate::AutocompleteResultErrorUnsupported,
+ NULL);
delete this;
return;
}
@@ -2177,7 +2178,7 @@ bool AutofillDialogControllerImpl::OnCancel() {
HidePopup();
if (!is_submitting_)
LogOnCancelMetrics();
- callback_.Run(NULL);
+ callback_.Run(AutofillManagerDelegate::AutocompleteResultErrorCancel, NULL);
return true;
}
@@ -2665,7 +2666,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),
@@ -3740,7 +3741,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.

Powered by Google App Engine
This is Rietveld 408576698