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

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

Issue 8680040: Group forms-related files in webkit/glue in a forms/ subdirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + another build fix Created 9 years 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
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/form_cache.h" 5 #include "chrome/renderer/autofill/form_cache.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/renderer/autofill/form_autofill_util.h" 9 #include "chrome/renderer/autofill/form_autofill_util.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h" 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormControlElement .h"
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputElement.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSelectElement.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSelectElement.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h"
19 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
20 #include "webkit/glue/form_data.h" 20 #include "webkit/forms/form_data.h"
21 #include "webkit/glue/form_data_predictions.h" 21 #include "webkit/forms/form_data_predictions.h"
22 #include "webkit/glue/form_field.h" 22 #include "webkit/forms/form_field.h"
23 #include "webkit/glue/form_field_predictions.h" 23 #include "webkit/forms/form_field_predictions.h"
24 24
25 using WebKit::WebDocument; 25 using WebKit::WebDocument;
26 using WebKit::WebFormControlElement; 26 using WebKit::WebFormControlElement;
27 using WebKit::WebFormElement; 27 using WebKit::WebFormElement;
28 using WebKit::WebFrame; 28 using WebKit::WebFrame;
29 using WebKit::WebInputElement; 29 using WebKit::WebInputElement;
30 using WebKit::WebSelectElement; 30 using WebKit::WebSelectElement;
31 using WebKit::WebString; 31 using WebKit::WebString;
32 using WebKit::WebVector; 32 using WebKit::WebVector;
33 using webkit_glue::FormData; 33 using webkit::forms::FormData;
34 using webkit_glue::FormDataPredictions; 34 using webkit::forms::FormDataPredictions;
35 35
36 namespace { 36 namespace {
37 37
38 // The number of fields required by Autofill. Ideally we could send the forms 38 // The number of fields required by Autofill. Ideally we could send the forms
39 // to Autofill no matter how many fields are in the forms; however, finding the 39 // to Autofill no matter how many fields are in the forms; however, finding the
40 // label for each field is a costly operation and we can't spare the cycles if 40 // label for each field is a costly operation and we can't spare the cycles if
41 // it's not necessary. 41 // it's not necessary.
42 const size_t kRequiredAutofillFields = 3; 42 const size_t kRequiredAutofillFields = 3;
43 43
44 // The maximum number of form fields we are willing to parse, due to 44 // The maximum number of form fields we are willing to parse, due to
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 UTF8ToUTF16(form.experiment_id)); 251 UTF8ToUTF16(form.experiment_id));
252 if (!element->hasAttribute("placeholder")) 252 if (!element->hasAttribute("placeholder"))
253 element->setAttribute("placeholder", WebString(UTF8ToUTF16(placeholder))); 253 element->setAttribute("placeholder", WebString(UTF8ToUTF16(placeholder)));
254 element->setAttribute("title", WebString(title)); 254 element->setAttribute("title", WebString(title));
255 } 255 }
256 256
257 return true; 257 return true;
258 } 258 }
259 259
260 } // namespace autofill 260 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/renderer/autofill/form_cache.h ('k') | chrome/renderer/autofill/password_autofill_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698