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 "chrome/browser/autocomplete/autocomplete_controller_delegate.h"
11 #include "chrome/browser/ui/app_list/search/search_provider.h"
13 class AutocompleteController
;
14 class AutocompleteResult
;
19 // OmniboxProvider wraps AutocompleteController to provide omnibox results.
20 class OmniboxProvider
: public SearchProvider
,
21 public AutocompleteControllerDelegate
{
23 explicit OmniboxProvider(Profile
* profile
);
24 virtual ~OmniboxProvider();
26 // SearchProvider overrides:
27 virtual void Start(const base::string16
& query
) OVERRIDE
;
28 virtual void Stop() OVERRIDE
;
31 // Populates result list from AutocompleteResult.
32 void PopulateFromACResult(const AutocompleteResult
& result
);
34 // AutocompleteControllerDelegate overrides:
35 virtual void OnResultChanged(bool default_match_changed
) OVERRIDE
;
39 // The omnibox AutocompleteController that collects/sorts/dup-
40 // eliminates the results as they come in.
41 scoped_ptr
<AutocompleteController
> controller_
;
43 DISALLOW_COPY_AND_ASSIGN(OmniboxProvider
);
46 } // namespace app_list
48 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_