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

Side by Side Diff: components/autofill/core/common/autofill_util.h

Issue 962673004: [Autofill/Autocomplete Feature] Substring matching instead of prefix matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unittest for Android bot. Created 5 years, 5 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_
6 #define COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_
7
8 #include "base/strings/string16.h"
9
10 namespace autofill {
11
12 // Returns true when command line switch |kEnableSuggestionsWithSubstringMatch|
13 // is on.
14 bool IsFeatureSubstringMatchEnabled();
15
16 // Returns true if the |field_contents| is a substring of the field's
vabr (Chromium) 2015/07/13 14:04:26 nit: What is "the field's |suggestion|"? Why not j
Pritam Nikam 2015/07/14 10:30:07 Done.
17 // |suggestion| starting at token boundaries. |field_contents| can span multiple
18 // |suggestion| tokens. A token is a sequences of contiguous characters
19 // separated by any of the characters that are part of delimiter set {' ', '.',
20 // ',', '-', '_', '@'}.
21 bool FieldIsSuggestionSubstringStartingOnTokenBoundary(
22 const base::string16& suggestion,
23 const base::string16& field_contents,
24 bool case_sensitive);
25
26 // Finds if the |field_contents| is a substring of the field's |suggestion|
27 // starting at token boundaries. |field_contents| can span multiple |suggestion|
28 // tokens. A token is a sequences of contiguous characters separated by any of
vabr (Chromium) 2015/07/13 14:04:26 Please do not repeat the definition of the token.
Pritam Nikam 2015/07/14 10:30:07 Done.
29 // the characters that are part of delimiter set {' ', '.', ',', '-', '_', '@'}.
30 // Returns the remaining autocompleted |suggestion| text's start position to
31 // apply the text selection in the field; base::string16::npos otherwise.
32 // "preview-on-hover" feature is one such use case where |field_contents| may
33 // not match |suggestion|.
34 size_t GetTextSelectionStart(const base::string16& suggestion,
35 const base::string16& field_contents,
36 bool case_sensitive);
37
38 } // namespace autofill
39
40 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698