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

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

Issue 1074343004: get rid of another inappropriate ToLowerASCII (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nodeleteallowed
Patch Set: Created 5 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_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 2a65982912e8b1309ac3e452aaafbc464e570bbf..5a80f67102028903fb3a3ccf056ba94781465c81 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -356,14 +356,6 @@ int AutofillPopupControllerImpl::GetIconResourceID(
return -1;
}
-bool AutofillPopupControllerImpl::CanDelete(size_t index) const {
- // TODO(isherman): Native AddressBook suggestions on Mac and Android should
- // not be considered to be deleteable.
- int id = suggestions_[index].frontend_id;
- return id > 0 || id == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY ||
- id == POPUP_ITEM_ID_PASSWORD_ENTRY;
-}
-
bool AutofillPopupControllerImpl::IsWarning(size_t index) const {
return suggestions_[index].frontend_id == POPUP_ITEM_ID_WARNING_MESSAGE;
}
@@ -508,11 +500,10 @@ bool AutofillPopupControllerImpl::RemoveSelectedLine() {
DCHECK_GE(selected_line_, 0);
DCHECK_LT(selected_line_, static_cast<int>(GetLineCount()));
- if (!CanDelete(selected_line_))
+ if (!delegate_->RemoveSuggestion(suggestions_[selected_line_].value,
+ suggestions_[selected_line_].frontend_id)) {
return false;
-
- delegate_->RemoveSuggestion(suggestions_[selected_line_].value,
- suggestions_[selected_line_].frontend_id);
+ }
// Remove the deleted element.
suggestions_.erase(suggestions_.begin() + selected_line_);

Powered by Google App Engine
This is Rietveld 408576698