Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_APP_LIST_SEARCH_PROVIDER_H_ | 5 #ifndef UI_APP_LIST_SEARCH_PROVIDER_H_ |
| 6 #define UI_APP_LIST_SEARCH_PROVIDER_H_ | 6 #define UI_APP_LIST_SEARCH_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "ui/app_list/app_list_export.h" | 13 #include "ui/app_list/app_list_export.h" |
| 14 | 14 |
| 15 namespace app_list { | 15 namespace app_list { |
| 16 | 16 |
| 17 class SearchResult; | 17 class SearchResult; |
| 18 | 18 |
| 19 class APP_LIST_EXPORT SearchProvider { | 19 class APP_LIST_EXPORT SearchProvider { |
| 20 public: | 20 public: |
| 21 typedef ScopedVector<SearchResult> Results; | 21 typedef ScopedVector<SearchResult> Results; |
| 22 typedef base::Closure ResultChangedCallback; | 22 typedef base::Closure ResultChangedCallback; |
| 23 | 23 |
| 24 SearchProvider(); | 24 SearchProvider(); |
| 25 virtual ~SearchProvider(); | 25 virtual ~SearchProvider(); |
| 26 | 26 |
| 27 // Invoked to start a query. | 27 // Invoked to start a query for recommendations. |
| 28 virtual void FetchRecommendations(); | |
|
Matt Giuca
2014/07/22 04:31:08
I'm wondering if it's simpler to just make Start("
calamity
2014/07/22 07:24:04
I agree. I walked in thinking this would be cleane
| |
| 29 | |
| 30 // Invoked to start a query for a search term. | |
| 28 virtual void Start(const base::string16& query) = 0; | 31 virtual void Start(const base::string16& query) = 0; |
| 29 | 32 |
| 30 // Invoked to stop the current query and no more results changes. | 33 // Invoked to stop the current query and no more results changes. |
| 31 virtual void Stop() = 0; | 34 virtual void Stop() = 0; |
| 32 | 35 |
| 33 void set_result_changed_callback(const ResultChangedCallback& callback) { | 36 void set_result_changed_callback(const ResultChangedCallback& callback) { |
| 34 result_changed_callback_ = callback; | 37 result_changed_callback_ = callback; |
| 35 } | 38 } |
| 36 | 39 |
| 37 // TODO(mukai): Fix the ownership and copying of the results. | 40 // TODO(mukai): Fix the ownership and copying of the results. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 49 | 52 |
| 50 ResultChangedCallback result_changed_callback_; | 53 ResultChangedCallback result_changed_callback_; |
| 51 Results results_; | 54 Results results_; |
| 52 | 55 |
| 53 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 56 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 54 }; | 57 }; |
| 55 | 58 |
| 56 } // namespace app_list | 59 } // namespace app_list |
| 57 | 60 |
| 58 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_ | 61 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_ |
| OLD | NEW |