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

Unified Diff: components/autofill/core/browser/autofill_manager.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: components/autofill/core/browser/autofill_manager.cc
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index b8ca3b1463094f5f3889d2b000a6208b393b865e..8d26935e387008ba285cb630089875fd97c6c9d3 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -705,27 +705,34 @@ void AutofillManager::OnHidePopup() {
client_->HideAutofillPopup();
}
-void AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) {
+bool AutofillManager::RemoveAutofillProfileOrCreditCard(int unique_id) {
std::string guid;
size_t variant = 0;
const CreditCard* credit_card = nullptr;
const AutofillProfile* profile = nullptr;
if (GetCreditCard(unique_id, &credit_card)) {
+ if (credit_card->record_type() != CreditCard::LOCAL_CARD)
+ return false;
+
guid = credit_card->guid();
} else if (GetProfile(unique_id, &profile, &variant)) {
+ if (profile->record_type() != AutofillProfile::LOCAL_PROFILE)
+ return false;
+
guid = profile->guid();
} else {
NOTREACHED();
- return;
+ return false;
}
// TODO(csharp): If we are dealing with a variant only the variant should
// be deleted, instead of doing nothing.
// http://crbug.com/124211
if (variant != 0)
- return;
+ return false;
personal_data_->RemoveByGUID(guid);
+ return true;
}
void AutofillManager::RemoveAutocompleteEntry(const base::string16& name,
« no previous file with comments | « components/autofill/core/browser/autofill_manager.h ('k') | components/autofill/core/browser/autofill_popup_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698