OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
11 #include "ui/app_list/search_provider.h" | 11 #include "ui/app_list/search_provider.h" |
12 | 12 |
13 class AppListControllerDelegate; | 13 class AppListControllerDelegate; |
14 class AutocompleteController; | 14 class AutocompleteController; |
15 class AutocompleteResult; | 15 class AutocompleteResult; |
16 class Profile; | 16 class Profile; |
17 | 17 |
18 namespace app_list { | 18 namespace app_list { |
19 | 19 |
20 // OmniboxProvider wraps AutocompleteController to provide omnibox results. | 20 // OmniboxProvider wraps AutocompleteController to provide omnibox results. |
21 class OmniboxProvider : public SearchProvider, | 21 class OmniboxProvider : public SearchProvider, |
22 public AutocompleteControllerDelegate { | 22 public AutocompleteControllerDelegate { |
23 public: | 23 public: |
24 explicit OmniboxProvider(Profile* profile, | 24 explicit OmniboxProvider(Profile* profile, |
25 AppListControllerDelegate* list_controller); | 25 AppListControllerDelegate* list_controller); |
26 virtual ~OmniboxProvider(); | 26 ~OmniboxProvider() override; |
27 | 27 |
28 // SearchProvider overrides: | 28 // SearchProvider overrides: |
29 virtual void Start(const base::string16& query) override; | 29 void Start(const base::string16& query) override; |
30 virtual void Stop() override; | 30 void Stop() override; |
31 | 31 |
32 private: | 32 private: |
33 // Populates result list from AutocompleteResult. | 33 // Populates result list from AutocompleteResult. |
34 void PopulateFromACResult(const AutocompleteResult& result); | 34 void PopulateFromACResult(const AutocompleteResult& result); |
35 | 35 |
36 // AutocompleteControllerDelegate overrides: | 36 // AutocompleteControllerDelegate overrides: |
37 virtual void OnResultChanged(bool default_match_changed) override; | 37 void OnResultChanged(bool default_match_changed) override; |
38 | 38 |
39 Profile* profile_; | 39 Profile* profile_; |
40 AppListControllerDelegate* list_controller_; | 40 AppListControllerDelegate* list_controller_; |
41 | 41 |
42 // The omnibox AutocompleteController that collects/sorts/dup- | 42 // The omnibox AutocompleteController that collects/sorts/dup- |
43 // eliminates the results as they come in. | 43 // eliminates the results as they come in. |
44 scoped_ptr<AutocompleteController> controller_; | 44 scoped_ptr<AutocompleteController> controller_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(OmniboxProvider); | 46 DISALLOW_COPY_AND_ASSIGN(OmniboxProvider); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace app_list | 49 } // namespace app_list |
50 | 50 |
51 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_ | 51 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_OMNIBOX_PROVIDER_H_ |
OLD | NEW |