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

Side by Side Diff: chrome/renderer/autofill/autofill_agent.cc

Issue 6915003: Don't dismiss Autofill suggestions when clicking on a field that currently has a popup open. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/renderer/autofill/autofill_agent.h" 5 #include "chrome/renderer/autofill/autofill_agent.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/common/autofill_messages.h" 9 #include "chrome/common/autofill_messages.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 303 }
304 autofill_action_ = AUTOFILL_NONE; 304 autofill_action_ = AUTOFILL_NONE;
305 Send(new AutofillHostMsg_DidFillAutofillFormData(routing_id())); 305 Send(new AutofillHostMsg_DidFillAutofillFormData(routing_id()));
306 } 306 }
307 307
308 void AutofillAgent::ShowSuggestions(const WebInputElement& element, 308 void AutofillAgent::ShowSuggestions(const WebInputElement& element,
309 bool autofill_on_empty_values, 309 bool autofill_on_empty_values,
310 bool requires_caret_at_end, 310 bool requires_caret_at_end,
311 bool display_warning_if_disabled) { 311 bool display_warning_if_disabled) {
312 if (!element.isEnabled() || element.isReadOnly() || !element.autoComplete() || 312 if (!element.isEnabled() || element.isReadOnly() || !element.autoComplete() ||
313 !element.isTextField() || element.isPasswordField()) 313 !element.isTextField() || element.isPasswordField() ||
314 !element.suggestedValue().isEmpty())
314 return; 315 return;
315 316
316 // If the field has no name, then we won't have values. 317 // If the field has no name, then we won't have values.
317 if (element.nameForAutofill().isEmpty()) 318 if (element.nameForAutofill().isEmpty())
318 return; 319 return;
319 320
320 // Don't attempt to autofill with values that are too large. 321 // Don't attempt to autofill with values that are too large.
321 WebString value = element.value(); 322 WebString value = element.value();
322 if (value.length() > kMaximumTextSizeForAutofill) 323 if (value.length() > kMaximumTextSizeForAutofill)
323 return; 324 return;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // WebFormControlElementToFormField does not scrape the DOM for the field 396 // WebFormControlElementToFormField does not scrape the DOM for the field
396 // label, so find the label here. 397 // label, so find the label here.
397 // TODO(jhawkins): Add form and field identities so we can use the cached form 398 // TODO(jhawkins): Add form and field identities so we can use the cached form
398 // data in FormManager. 399 // data in FormManager.
399 field->label = FormManager::LabelForElement(element); 400 field->label = FormManager::LabelForElement(element);
400 401
401 return true; 402 return true;
402 } 403 }
403 404
404 } // namespace autofill 405 } // 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