| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BUILDER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_BUILDER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_BUILDER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" | 11 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
| 12 #include "ui/app_list/app_list_model.h" | 12 #include "ui/app_list/app_list_model.h" |
| 13 | 13 |
| 14 namespace app_list { | 14 namespace app_list { |
| 15 class SearchBoxModel; | 15 class SearchBoxModel; |
| 16 class SearchResult; | 16 class SearchResult; |
| 17 } | 17 } |
| 18 | 18 |
| 19 class AppListController; | 19 class AppListControllerDelegate; |
| 20 class AutocompleteController; | 20 class AutocompleteController; |
| 21 class AutocompleteResult; | 21 class AutocompleteResult; |
| 22 class Profile; | 22 class Profile; |
| 23 | 23 |
| 24 // SearchBuilder creates app list search results via AutoCompleteController. | 24 // SearchBuilder creates app list search results via AutoCompleteController. |
| 25 class SearchBuilder : public AutocompleteControllerDelegate { | 25 class SearchBuilder : public AutocompleteControllerDelegate { |
| 26 public: | 26 public: |
| 27 SearchBuilder(Profile* profile, | 27 SearchBuilder(Profile* profile, |
| 28 app_list::SearchBoxModel* search_box, | 28 app_list::SearchBoxModel* search_box, |
| 29 app_list::AppListModel::SearchResults* results, | 29 app_list::AppListModel::SearchResults* results, |
| 30 AppListController* list_controller); | 30 AppListControllerDelegate* list_controller); |
| 31 virtual ~SearchBuilder(); | 31 virtual ~SearchBuilder(); |
| 32 | 32 |
| 33 void StartSearch(); | 33 void StartSearch(); |
| 34 void StopSearch(); | 34 void StopSearch(); |
| 35 | 35 |
| 36 // Opens |result|. | 36 // Opens |result|. |
| 37 void OpenResult(const app_list::SearchResult& result, int event_flags); | 37 void OpenResult(const app_list::SearchResult& result, int event_flags); |
| 38 | 38 |
| 39 // Invokes a custom action on |result|. |action_index| corresponds to the | 39 // Invokes a custom action on |result|. |action_index| corresponds to the |
| 40 // index of the selected icon in |result.action_icons()|. | 40 // index of the selected icon in |result.action_icons()|. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 53 | 53 |
| 54 // Sub models of AppListModel that represent search box and result list. | 54 // Sub models of AppListModel that represent search box and result list. |
| 55 app_list::SearchBoxModel* search_box_; | 55 app_list::SearchBoxModel* search_box_; |
| 56 app_list::AppListModel::SearchResults* results_; | 56 app_list::AppListModel::SearchResults* results_; |
| 57 | 57 |
| 58 // The omnibox AutocompleteController that collects/sorts/dup- | 58 // The omnibox AutocompleteController that collects/sorts/dup- |
| 59 // eliminates the results as they come in. | 59 // eliminates the results as they come in. |
| 60 scoped_ptr<AutocompleteController> controller_; | 60 scoped_ptr<AutocompleteController> controller_; |
| 61 | 61 |
| 62 // The controller of the app list. Owned by the app list delegate. | 62 // The controller of the app list. Owned by the app list delegate. |
| 63 AppListController* list_controller_; | 63 AppListControllerDelegate* list_controller_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(SearchBuilder); | 65 DISALLOW_COPY_AND_ASSIGN(SearchBuilder); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_BUILDER_H_ | 68 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_BUILDER_H_ |
| OLD | NEW |