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

Side by Side Diff: components/autofill/core/browser/autofill_external_delegate.cc

Issue 246833006: Filter out datalist values for textarea field from renderer side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not insert datalist as suggestions for textarea field. Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698