OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/autofill/core/browser/autofill_external_delegate.h" | 5 #include "components/autofill/core/browser/autofill_external_delegate.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "components/autofill/core/browser/autocomplete_history_manager.h" | 8 #include "components/autofill/core/browser/autocomplete_history_manager.h" |
9 #include "components/autofill/core/browser/autofill_driver.h" | 9 #include "components/autofill/core/browser/autofill_driver.h" |
10 #include "components/autofill/core/browser/autofill_manager.h" | 10 #include "components/autofill/core/browser/autofill_manager.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 driver_->RendererShouldFillFieldWithValue(value); | 193 driver_->RendererShouldFillFieldWithValue(value); |
194 } else { | 194 } else { |
195 FillAutofillFormData(identifier, false); | 195 FillAutofillFormData(identifier, false); |
196 } | 196 } |
197 | 197 |
198 manager_->delegate()->HideAutofillPopup(); | 198 manager_->delegate()->HideAutofillPopup(); |
199 } | 199 } |
200 | 200 |
201 void AutofillExternalDelegate::RemoveSuggestion(const base::string16& value, | 201 void AutofillExternalDelegate::RemoveSuggestion(const base::string16& value, |
202 int identifier) { | 202 int identifier) { |
203 if (identifier > 0) | 203 if (identifier > 0) { |
204 manager_->RemoveAutofillProfileOrCreditCard(identifier); | 204 manager_->RemoveAutofillProfileOrCreditCard(identifier); |
205 else | 205 } else if (identifier == POPUP_ITEM_ID_PASSWORD_ENTRY) { |
| 206 bool success = |
| 207 password_manager_.RemovePasswordSuggestion(query_field_, value); |
| 208 DCHECK(success); |
| 209 } else { |
| 210 DCHECK(identifier == POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY); |
206 manager_->RemoveAutocompleteEntry(query_field_.name, value); | 211 manager_->RemoveAutocompleteEntry(query_field_.name, value); |
| 212 } |
207 } | 213 } |
208 | 214 |
209 void AutofillExternalDelegate::DidEndTextFieldEditing() { | 215 void AutofillExternalDelegate::DidEndTextFieldEditing() { |
210 manager_->delegate()->HideAutofillPopup(); | 216 manager_->delegate()->HideAutofillPopup(); |
211 | 217 |
212 has_shown_popup_for_current_edit_ = false; | 218 has_shown_popup_for_current_edit_ = false; |
213 } | 219 } |
214 | 220 |
215 void AutofillExternalDelegate::ClearPreviewedForm() { | 221 void AutofillExternalDelegate::ClearPreviewedForm() { |
216 driver_->RendererShouldClearPreviewedForm(); | 222 driver_->RendererShouldClearPreviewedForm(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // Set the values that all datalist elements share. | 350 // Set the values that all datalist elements share. |
345 icons->insert(icons->begin(), | 351 icons->insert(icons->begin(), |
346 data_list_values_.size(), | 352 data_list_values_.size(), |
347 base::string16()); | 353 base::string16()); |
348 unique_ids->insert(unique_ids->begin(), | 354 unique_ids->insert(unique_ids->begin(), |
349 data_list_values_.size(), | 355 data_list_values_.size(), |
350 POPUP_ITEM_ID_DATALIST_ENTRY); | 356 POPUP_ITEM_ID_DATALIST_ENTRY); |
351 } | 357 } |
352 | 358 |
353 } // namespace autofill | 359 } // namespace autofill |
OLD | NEW |