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

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

Issue 1134793004: Autofill item deletion on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 7 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_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
index 5a80f67102028903fb3a3ccf056ba94781465c81..e7ebd3b80e00eca4c483df98a513a9f387b63357 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -417,6 +417,38 @@ const base::string16& AutofillPopupControllerImpl::GetElidedLabelAt(
return elided_labels_[row];
}
+bool AutofillPopupControllerImpl::GetRemovalConfirmationText(
+ int list_index,
+ base::string16* title,
+ base::string16* body) {
+ return delegate_->GetDeletionConfirmationText(
+ suggestions_[list_index].value, suggestions_[list_index].frontend_id,
+ title, body);
+}
+
+bool AutofillPopupControllerImpl::RemoveSuggestion(int list_index) {
+ if (!delegate_->RemoveSuggestion(suggestions_[list_index].value,
+ suggestions_[list_index].frontend_id)) {
+ return false;
+ }
+
+ // Remove the deleted element.
+ suggestions_.erase(suggestions_.begin() + list_index);
+ elided_values_.erase(elided_values_.begin() + list_index);
+ elided_labels_.erase(elided_labels_.begin() + list_index);
+
+ SetSelectedLine(kNoSelection);
+
+ if (HasSuggestions()) {
+ delegate_->ClearPreviewedForm();
+ UpdateBoundsAndRedrawPopup();
+ } else {
+ Hide();
+ }
+
+ return true;
+}
+
#if !defined(OS_ANDROID)
const gfx::FontList& AutofillPopupControllerImpl::GetValueFontListForRow(
size_t index) const {
@@ -499,27 +531,7 @@ bool AutofillPopupControllerImpl::RemoveSelectedLine() {
DCHECK_GE(selected_line_, 0);
DCHECK_LT(selected_line_, static_cast<int>(GetLineCount()));
-
- if (!delegate_->RemoveSuggestion(suggestions_[selected_line_].value,
- suggestions_[selected_line_].frontend_id)) {
- return false;
- }
-
- // Remove the deleted element.
- suggestions_.erase(suggestions_.begin() + selected_line_);
- elided_values_.erase(elided_values_.begin() + selected_line_);
- elided_labels_.erase(elided_labels_.begin() + selected_line_);
-
- SetSelectedLine(kNoSelection);
-
- if (HasSuggestions()) {
- delegate_->ClearPreviewedForm();
- UpdateBoundsAndRedrawPopup();
- } else {
- Hide();
- }
-
- return true;
+ return RemoveSuggestion(selected_line_);
}
int AutofillPopupControllerImpl::LineFromY(int y) {

Powered by Google App Engine
This is Rietveld 408576698