DescriptionClean up ShortcutsProvider and related classes:
* Move SpansToString()/SpansFromString() and AddLastMatchIfNeeded() from static functions in shortcuts_provider_shortcut.cc to static members on AutocompleteMatch and rename them, to go along with the other existing classification-related functions there, since there's nothing particularly shortcut-related about them.
* Move the definitions of Shortcut and ShortcutMap to the ShortcutsBackend, mainly to "namespace" them -- having a global-scope type named "Shortcut" didn't seem like a good idea. This made sense as a location anyway since the backend already depended heavily on these types.
* Eliminate using statements.
* Modify ShortcutsProviderTest::FillData() so it can be reused in an additional place.
* Shortcut had two different constructors whose function and use was confusing and error-prone -- they took some of the same fields but as different types, and didn't guarantee all the members were initialized. Condense to one constructor which takes the most logical types and sets all members.
* Eliminate ShortcutsBackend::guid_map() (unused).
* Simplify/clarify code.
* Eliminate 2K clamp on shortcut data fields. We don't clamp like this elsewhere, and if the clamp kicks in, it could lead to corrupted results -- e.g. trimming a "description" field but not updating the classifications for that field.
BUG=none
TEST=none
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=126743
Patch Set 1 #
Total comments: 5
Messages
Total messages: 5 (0 generated)
|