Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / app_list / search / omnibox_provider.h
blob17203b56e2480b7d82f4eb617219d18ac230b17c
1 // Copyright 2013 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.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/omnibox/browser/autocomplete_controller_delegate.h"
11 #include "ui/app_list/search_provider.h"
13 class AppListControllerDelegate;
14 class AutocompleteController;
15 class AutocompleteResult;
16 class Profile;
18 namespace app_list {
20 // OmniboxProvider wraps AutocompleteController to provide omnibox results.
21 class OmniboxProvider : public SearchProvider,
22 public AutocompleteControllerDelegate {
23 public:
24 explicit OmniboxProvider(Profile* profile,
25 AppListControllerDelegate* list_controller);
26 ~OmniboxProvider() override;
28 // SearchProvider overrides:
29 void Start(bool is_voice_query, const base::string16& query) override;
30 void Stop() override;
32 private:
33 // Populates result list from AutocompleteResult.
34 void PopulateFromACResult(const AutocompleteResult& result);
36 // AutocompleteControllerDelegate overrides:
37 void OnResultChanged(bool default_match_changed) override;
39 Profile* profile_;
40 AppListControllerDelegate* list_controller_;
42 // The omnibox AutocompleteController that collects/sorts/dup-
43 // eliminates the results as they come in.
44 scoped_ptr<AutocompleteController> controller_;
46 // Whether the current query is a voice query.
47 bool is_voice_query_;
49 DISALLOW_COPY_AND_ASSIGN(OmniboxProvider);
52 } // namespace app_list
54 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_