Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 DCHECK_GT(ids.size(), 0U); | 81 DCHECK_GT(ids.size(), 0U); |
| 82 if (ids.back() == POPUP_ITEM_ID_SEPARATOR) { | 82 if (ids.back() == POPUP_ITEM_ID_SEPARATOR) { |
| 83 values.pop_back(); | 83 values.pop_back(); |
| 84 labels.pop_back(); | 84 labels.pop_back(); |
| 85 icons.pop_back(); | 85 icons.pop_back(); |
| 86 ids.pop_back(); | 86 ids.pop_back(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // If anything else is added to modify the values after inserting the data | 89 // If anything else is added to modify the values after inserting the data |
| 90 // list, AutofillPopupControllerImpl::UpdateDataListValues will need to be | 90 // list, AutofillPopupControllerImpl::UpdateDataListValues will need to be |
| 91 // updated to match. | 91 // updated to match. This is for input element only. |
| 92 InsertDataListValues(&values, &labels, &icons, &ids); | 92 if (query_field_.form_control_type != "textarea") |
| 93 InsertDataListValues(&values, &labels, &icons, &ids); | |
|
Ilya Sherman
2014/04/28 21:23:14
We should filter out datalist values on the render
| |
| 93 | 94 |
| 94 if (values.empty()) { | 95 if (values.empty()) { |
| 95 // No suggestions, any popup currently showing is obsolete. | 96 // No suggestions, any popup currently showing is obsolete. |
| 96 manager_->delegate()->HideAutofillPopup(); | 97 manager_->delegate()->HideAutofillPopup(); |
| 97 return; | 98 return; |
| 98 } | 99 } |
| 99 | 100 |
| 100 // Send to display. | 101 // Send to display. |
| 101 if (query_field_.is_focusable) { | 102 if (query_field_.is_focusable) { |
| 102 manager_->delegate()->ShowAutofillPopup( | 103 manager_->delegate()->ShowAutofillPopup( |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 // Set the values that all datalist elements share. | 303 // Set the values that all datalist elements share. |
| 303 icons->insert(icons->begin(), | 304 icons->insert(icons->begin(), |
| 304 data_list_values_.size(), | 305 data_list_values_.size(), |
| 305 base::string16()); | 306 base::string16()); |
| 306 unique_ids->insert(unique_ids->begin(), | 307 unique_ids->insert(unique_ids->begin(), |
| 307 data_list_values_.size(), | 308 data_list_values_.size(), |
| 308 POPUP_ITEM_ID_DATALIST_ENTRY); | 309 POPUP_ITEM_ID_DATALIST_ENTRY); |
| 309 } | 310 } |
| 310 | 311 |
| 311 } // namespace autofill | 312 } // namespace autofill |
| OLD | NEW |