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 { | |
Ilya Sherman
2014/04/09 06:33:05
nit: Please DCHECK that the identifier is for an a
rchtara
2014/04/09 13:52:43
Done.
| |
206 manager_->RemoveAutocompleteEntry(query_field_.name, value); | 210 manager_->RemoveAutocompleteEntry(query_field_.name, value); |
211 } | |
207 } | 212 } |
208 | 213 |
209 void AutofillExternalDelegate::DidEndTextFieldEditing() { | 214 void AutofillExternalDelegate::DidEndTextFieldEditing() { |
210 manager_->delegate()->HideAutofillPopup(); | 215 manager_->delegate()->HideAutofillPopup(); |
211 | 216 |
212 has_shown_popup_for_current_edit_ = false; | 217 has_shown_popup_for_current_edit_ = false; |
213 } | 218 } |
214 | 219 |
215 void AutofillExternalDelegate::ClearPreviewedForm() { | 220 void AutofillExternalDelegate::ClearPreviewedForm() { |
216 driver_->RendererShouldClearPreviewedForm(); | 221 driver_->RendererShouldClearPreviewedForm(); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
344 // Set the values that all datalist elements share. | 349 // Set the values that all datalist elements share. |
345 icons->insert(icons->begin(), | 350 icons->insert(icons->begin(), |
346 data_list_values_.size(), | 351 data_list_values_.size(), |
347 base::string16()); | 352 base::string16()); |
348 unique_ids->insert(unique_ids->begin(), | 353 unique_ids->insert(unique_ids->begin(), |
349 data_list_values_.size(), | 354 data_list_values_.size(), |
350 POPUP_ITEM_ID_DATALIST_ENTRY); | 355 POPUP_ITEM_ID_DATALIST_ENTRY); |
351 } | 356 } |
352 | 357 |
353 } // namespace autofill | 358 } // namespace autofill |
OLD | NEW |