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

Unified Diff: chrome/renderer/autofill_helper.cc

Issue 6301005: Fix autocomplete for Gmail subject lines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill_helper.cc
diff --git a/chrome/renderer/autofill_helper.cc b/chrome/renderer/autofill_helper.cc
index b3835045bafb7cfd951d852fd20bd9711fa6fb57..8299c6f774035d4db2ade9619e5c70f2efe268da 100644
--- a/chrome/renderer/autofill_helper.cc
+++ b/chrome/renderer/autofill_helper.cc
@@ -270,8 +270,20 @@ void AutoFillHelper::QueryAutoFillSuggestions(
webkit_glue::FormData form;
webkit_glue::FormField field;
- if (!FindFormAndFieldForNode(node, &form, &field))
- return;
+ if (!FindFormAndFieldForNode(node, &form, &field)) {
+ // If we didn't find the cached form, at least let autocomplete have a shot
+ // at providing suggestions.
+ FormManager::WebFormControlElementToFormField(
+ node.toConst<WebFormControlElement>(), FormManager::EXTRACT_VALUE,
+ &field);
+
+ // Really, though, this case should not be reachable. Log the source website
+ // to help debug why we do sometimes reach this case.
+ GURL url = node.document().frame()->url();
dhollowa 2011/01/14 16:13:28 As tempting as this logging may be, there are priv
+ LOG(WARNING) << "Failed to find cached form at "
+ << url.GetOrigin().spec()
+ << ". Please add this URL to http://crbug.com/69611.";
+ }
render_view_->Send(new ViewHostMsg_QueryFormFieldAutoFill(
render_view_->routing_id(), autofill_query_id_, form, field));
« 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