#include <string>
#include "base/gtest_prod_util.h"
-#include "chrome/browser/autocomplete/autocomplete_provider.h"
#include "chrome/browser/autocomplete/shortcuts_backend.h"
-#include "chrome/browser/autocomplete/url_prefix.h"
+#include "components/omnibox/autocomplete_provider.h"
class Profile;
class ShortcutsProviderTest;
: public AutocompleteProvider,
public ShortcutsBackend::ShortcutsBackendObserver {
public:
- ShortcutsProvider(AutocompleteProviderListener* listener, Profile* profile);
+ explicit ShortcutsProvider(Profile* profile);
// Performs the autocompletion synchronously. Since no asynch completion is
// performed |minimal_changes| is ignored.
- virtual void Start(const AutocompleteInput& input,
- bool minimal_changes) OVERRIDE;
+ void Start(const AutocompleteInput& input, bool minimal_changes) override;
- virtual void DeleteMatch(const AutocompleteMatch& match) OVERRIDE;
+ void DeleteMatch(const AutocompleteMatch& match) override;
private:
friend class ClassifyTest;
typedef std::multimap<base::char16, base::string16> WordMap;
- virtual ~ShortcutsProvider();
+ ~ShortcutsProvider() override;
// ShortcutsBackendObserver:
- virtual void OnShortcutsLoaded() OVERRIDE;
+ void OnShortcutsLoaded() override;
// Performs the autocomplete matching and scoring.
void GetMatches(const AutocompleteInput& input);
// Returns an AutocompleteMatch corresponding to |shortcut|. Assigns it
// |relevance| score in the process, and highlights the description and
- // contents against |input|, which should be the lower-cased version
- // of the user's input. |input|, |fixed_up_input|, and
- // |input_as_gurl| are used to decide what can be inlined.
+ // contents against |input|, which should be the lower-cased version of
+ // the user's input. |input| and |fixed_up_input_text| are used to decide
+ // what can be inlined.
AutocompleteMatch ShortcutToACMatch(
const history::ShortcutsDatabase::Shortcut& shortcut,
int relevance,
const AutocompleteInput& input,
- const AutocompleteInput& fixed_up_input,
- const GURL& input_as_gurl);
+ const base::string16& fixed_up_input_text);
// Returns a map mapping characters to groups of words from |text| that start
// with those characters, ordered lexicographically descending so that longer
// The default max relevance unless overridden by a field trial.
static const int kShortcutsProviderDefaultMaxRelevance;
+ Profile* profile_;
std::string languages_;
bool initialized_;
};