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

Unified Diff: chrome/browser/autofill/autofill_external_delegate.cc

Issue 10073018: Add Delete Support to New Autofill UI (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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/autofill/autofill_external_delegate.cc
diff --git a/chrome/browser/autofill/autofill_external_delegate.cc b/chrome/browser/autofill/autofill_external_delegate.cc
index ff94bd4ec72a6d5a318b8a51c4dfc6f14ce83c70..8131682927cfac33049d0fdca7505d72f51025dd 100644
--- a/chrome/browser/autofill/autofill_external_delegate.cc
+++ b/chrome/browser/autofill/autofill_external_delegate.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/utf_string_conversions.h"
+#include "chrome/browser/autocomplete_history_manager.h"
#include "chrome/browser/autofill/autofill_external_delegate.h"
#include "chrome/browser/autofill/autofill_manager.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
@@ -170,6 +171,20 @@ void AutofillExternalDelegate::OnShowPasswordSuggestions(
ApplyAutofillSuggestions(suggestions, empty, empty, password_ids, -1);
}
+void AutofillExternalDelegate::RemoveAutocompleteEntry(const string16& value) {
+ if (tab_contents_wrapper_) {
Ilya Sherman 2012/04/17 08:31:20 nit: Is it actually possible for this to be NULL?
csharp 2012/04/18 15:35:58 In some tests right now, but I don't think it coul
Ilya Sherman 2012/04/18 18:12:51 Ok. I think it would be better to use mocked obje
+ tab_contents_wrapper_->autocomplete_history_manager()->
+ OnRemoveAutocompleteEntry(autofill_query_field_.name, value);
+ }
+
+ // Adjust the positions of the non-Autocomplete menu items.
+ if (suggestions_clear_index_ != -1)
+ --suggestions_clear_index_;
+
+ if (suggestions_options_index_ != -1)
+ --suggestions_options_index_;
+}
+
void AutofillExternalDelegate::DidEndTextFieldEditing() {
has_shown_autofill_popup_for_current_edit_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698