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

Unified Diff: components/autofill/core/browser/form_structure.h

Issue 1622073002: [Autofill] Remove longest common prefix from field names when running heuristics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: std::move Created 4 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 | « components/autofill/core/browser/form_field.cc ('k') | components/autofill/core/browser/form_structure.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/form_structure.h
diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h
index 9f86d560c5d3761382790aaf647f74de7a6e93d0..1a14f8d76bd7cdbb1b8aeb199b451a786e62e16b 100644
--- a/components/autofill/core/browser/form_structure.h
+++ b/components/autofill/core/browser/form_structure.h
@@ -17,6 +17,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
+#include "base/strings/string_piece.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/field_types.h"
@@ -215,6 +216,7 @@ class FormStructure {
private:
friend class FormStructureTest;
FRIEND_TEST_ALL_PREFIXES(AutofillDownloadTest, QueryAndUploadTest);
+ FRIEND_TEST_ALL_PREFIXES(FormStructureTest, FindLongestCommonPrefix);
// Encodes information about this form and its fields into |query_form|.
void EncodeFormForQuery(
@@ -243,6 +245,15 @@ class FormStructure {
// Returns true if field should be skipped when talking to Autofill server.
bool ShouldSkipField(const FormFieldData& field) const;
+ // Further processes the extracted |fields_|.
+ void ProcessExtractedFields();
+
+ // Returns the longest common prefix found within |strings|. IMPORTANT: the
+ // returned StringPiece16 is a view into |strings| and the latter must remain
+ // valid while the StringPiece16 is used.
+ static base::StringPiece16 FindLongestCommonPrefix(
+ const std::vector<base::string16>& strings);
+
// The name of the form.
base::string16 form_name_;
« no previous file with comments | « components/autofill/core/browser/form_field.cc ('k') | components/autofill/core/browser/form_structure.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698