OLD | NEW |
---|---|
(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_ | |
OLD | NEW |