| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_APP_LIST_SEARCH_BUILDER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ASH_APP_LIST_SEARCH_BUILDER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
| 12 #include "ui/app_list/app_list_model.h" |
| 13 |
| 14 namespace app_list { |
| 15 class SearchBoxModel; |
| 16 class SearchResult; |
| 17 } |
| 18 |
| 19 class AutocompleteController; |
| 20 class Profile; |
| 21 |
| 22 // SearchBuilder creates app list search results via AutoCompleteController. |
| 23 class SearchBuilder : public AutocompleteControllerDelegate { |
| 24 public: |
| 25 SearchBuilder(Profile* profile, |
| 26 app_list::SearchBoxModel* search_box, |
| 27 app_list::AppListModel::SearchResults* results); |
| 28 virtual ~SearchBuilder(); |
| 29 |
| 30 void StartSearch(); |
| 31 void StopSearch(); |
| 32 |
| 33 void OpenResult(const app_list::SearchResult& result, int event_flags); |
| 34 |
| 35 private: |
| 36 // AutocompleteControllerDelegate overrides: |
| 37 virtual void OnResultChanged(bool default_match_changed) OVERRIDE; |
| 38 |
| 39 Profile* profile_; |
| 40 |
| 41 // Sub models of AppListModel that represent search box and result list. |
| 42 app_list::SearchBoxModel* search_box_; |
| 43 app_list::AppListModel::SearchResults* results_; |
| 44 |
| 45 // The omnibox AutocompleteController that collects/sorts/dup- |
| 46 // eliminates the results as they come in. |
| 47 scoped_ptr<AutocompleteController> controller_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(SearchBuilder); |
| 50 }; |
| 51 |
| 52 #endif // CHROME_BROWSER_UI_VIEWS_ASH_APP_LIST_SEARCH_BUILDER_H_ |
| OLD | NEW |