Chromium Code Reviews| 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..2a4b40861577e5650d8617baedcb894b0e309f24 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" |
| @@ -17,10 +18,6 @@ |
| using content::RenderViewHost; |
| namespace { |
| - |
| -// The value to give as the unique id for all warnings. |
| -const int kWarningId = -1; |
| - |
| // The value to give as the unique id for all password entries. |
| const int kPasswordEntryId = -2; |
| @@ -170,6 +167,23 @@ void AutofillExternalDelegate::OnShowPasswordSuggestions( |
| ApplyAutofillSuggestions(suggestions, empty, empty, password_ids, -1); |
| } |
| +void AutofillExternalDelegate::RemoveAutocompleteEntry(const string16& value) { |
| + if (tab_contents_wrapper_) { |
| + tab_contents_wrapper_->autocomplete_history_manager()-> |
| + OnRemoveAutocompleteEntry(autofill_query_field_.name, value); |
| + } |
| + |
| + AdjustIndicesAfterDeletion(); |
|
Ilya Sherman
2012/04/18 18:12:51
nit: This probably makes sense to do in a follow-u
csharp
2012/04/19 15:33:24
I just added that to this change. Let me remove a
|
| +} |
| + |
| +void AutofillExternalDelegate::RemoveAutofillProfileOrCreditCard( |
| + int unique_id) { |
| + autofill_manager_->RemoveAutofillProfileOrCreditCard(unique_id); |
| + |
| + AdjustIndicesAfterDeletion(); |
| +} |
| + |
| + |
| void AutofillExternalDelegate::DidEndTextFieldEditing() { |
| has_shown_autofill_popup_for_current_edit_ = false; |
| } |
| @@ -261,6 +275,14 @@ void AutofillExternalDelegate::FillAutofillFormData(int unique_id, |
| unique_id); |
| } |
| +void AutofillExternalDelegate::AdjustIndicesAfterDeletion() { |
| + if (suggestions_clear_index_ != -1) |
| + --suggestions_clear_index_; |
| + |
| + if (suggestions_options_index_ != -1) |
| + --suggestions_options_index_; |
| +} |
| + |
| // Add a "!defined(OS_YOUROS) for each platform that implements this |
| // in an autofill_external_delegate_YOUROS.cc. Currently there are |
| // none, so all platforms use the default. |