| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "components/autofill/core/common/form_field_data.h" | 14 #include "components/autofill/core/common/form_field_data.h" |
| 15 | 15 |
| 16 namespace autofill { | 16 namespace autofill { |
| 17 | 17 |
| 18 // Returns true when command line switch |kEnableSuggestionsWithSubstringMatch| | 18 // Returns true when command line switch |kEnableSuggestionsWithSubstringMatch| |
| 19 // is on. | 19 // is on. |
| 20 bool IsFeatureSubstringMatchEnabled(); | 20 bool IsFeatureSubstringMatchEnabled(); |
| 21 | 21 |
| 22 // Returns true if showing autofill signature as HTML attributes is enabled. |
| 23 bool IsShowAutofillSignaturesEnabled(); |
| 24 |
| 22 // Returns true when keyboard accessory is enabled. | 25 // Returns true when keyboard accessory is enabled. |
| 23 bool IsKeyboardAccessoryEnabled(); | 26 bool IsKeyboardAccessoryEnabled(); |
| 24 | 27 |
| 25 // A token is a sequences of contiguous characters separated by any of the | 28 // A token is a sequences of contiguous characters separated by any of the |
| 26 // characters that are part of delimiter set {' ', '.', ',', '-', '_', '@'}. | 29 // characters that are part of delimiter set {' ', '.', ',', '-', '_', '@'}. |
| 27 | 30 |
| 28 // Returns true if the |field_contents| is a substring of the |suggestion| | 31 // Returns true if the |field_contents| is a substring of the |suggestion| |
| 29 // starting at token boundaries. |field_contents| can span multiple |suggestion| | 32 // starting at token boundaries. |field_contents| can span multiple |suggestion| |
| 30 // tokens. | 33 // tokens. |
| 31 bool FieldIsSuggestionSubstringStartingOnTokenBoundary( | 34 bool FieldIsSuggestionSubstringStartingOnTokenBoundary( |
| (...skipping 24 matching lines...) Expand all Loading... |
| 56 | 59 |
| 57 // Lowercases and tokenizes a given |attribute| string. | 60 // Lowercases and tokenizes a given |attribute| string. |
| 58 // Considers any ASCII whitespace character as a possible separator. | 61 // Considers any ASCII whitespace character as a possible separator. |
| 59 // Also ignores empty tokens, resulting in a collapsing of whitespace. | 62 // Also ignores empty tokens, resulting in a collapsing of whitespace. |
| 60 std::vector<std::string> LowercaseAndTokenizeAttributeString( | 63 std::vector<std::string> LowercaseAndTokenizeAttributeString( |
| 61 const std::string& attribute); | 64 const std::string& attribute); |
| 62 | 65 |
| 63 } // namespace autofill | 66 } // namespace autofill |
| 64 | 67 |
| 65 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_ | 68 #endif // COMPONENTS_AUTOFILL_CORE_COMMON_AUTOFILL_UTIL_H_ |
| OLD | NEW |