| 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 <memory> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 13 #include "ui/app_list/app_list_export.h" | 14 #include "ui/app_list/app_list_export.h" |
| 14 | 15 |
| 15 namespace app_list { | 16 namespace app_list { |
| 16 | 17 |
| 17 class SearchResult; | 18 class SearchResult; |
| 18 | 19 |
| 19 class APP_LIST_EXPORT SearchProvider { | 20 class APP_LIST_EXPORT SearchProvider { |
| 20 public: | 21 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 virtual void Stop() = 0; | 32 virtual void Stop() = 0; |
| 32 | 33 |
| 33 void set_result_changed_callback(const ResultChangedCallback& callback) { | 34 void set_result_changed_callback(const ResultChangedCallback& callback) { |
| 34 result_changed_callback_ = callback; | 35 result_changed_callback_ = callback; |
| 35 } | 36 } |
| 36 | 37 |
| 37 const Results& results() const { return results_; } | 38 const Results& results() const { return results_; } |
| 38 | 39 |
| 39 protected: | 40 protected: |
| 40 // Interface for the derived class to generate search results. | 41 // Interface for the derived class to generate search results. |
| 41 void Add(scoped_ptr<SearchResult> result); | 42 void Add(std::unique_ptr<SearchResult> result); |
| 42 void ClearResults(); | 43 void ClearResults(); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 void FireResultChanged(); | 46 void FireResultChanged(); |
| 46 | 47 |
| 47 ResultChangedCallback result_changed_callback_; | 48 ResultChangedCallback result_changed_callback_; |
| 48 Results results_; | 49 Results results_; |
| 49 | 50 |
| 50 DISALLOW_COPY_AND_ASSIGN(SearchProvider); | 51 DISALLOW_COPY_AND_ASSIGN(SearchProvider); |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 } // namespace app_list | 54 } // namespace app_list |
| 54 | 55 |
| 55 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_ | 56 #endif // UI_APP_LIST_SEARCH_PROVIDER_H_ |
| OLD | NEW |