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

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: Incorporated Vaclav's review comments. 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 // A token is a sequences of contiguous characters separated by any of the
17 // characters that are part of delimiter set {' ', '.', ',', '-', '_', '@'}.
18
19 // Returns true if the |field_contents| is a substring of the |suggestion|
20 // starting at token boundaries. |field_contents| can span multiple |suggestion|
21 // tokens.
22 bool FieldIsSuggestionSubstringStartingOnTokenBoundary(
23 const base::string16& suggestion,
24 const base::string16& field_contents,
25 bool case_sensitive);
26
27 // Finds the first occurrence of a searched substring |field_contents| within
28 // the string |suggestion| starting at token boundaries and returns the index to
29 // the end of the located substring, or base::string16::npos if the substring is
30 // not found. "preview-on-hover" feature is one such use case where the
31 // substring |field_contents| may not be found within the string |suggestion|.
32 size_t GetTextSelectionStart(const base::string16& suggestion,
33 const base::string16& field_contents,
34 bool case_sensitive);
35
36 } // namespace autofill
37
38 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_
OLDNEW
« no previous file with comments | « components/autofill/core/common/autofill_switches.cc ('k') | components/autofill/core/common/autofill_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698