| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 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_APP_LIST_SEARCH_ARC_ARC_PLAYSTORE_SEARCH_PROVIDER_H_ | |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_ARC_ARC_PLAYSTORE_SEARCH_PROVIDER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "components/arc/common/app.mojom.h" | |
| 12 #include "ui/app_list/search_provider.h" | |
| 13 | |
| 14 class Profile; | |
| 15 class AppListControllerDelegate; | |
| 16 | |
| 17 namespace app_list { | |
| 18 | |
| 19 class ArcPlayStoreSearchProvider : public SearchProvider { | |
| 20 public: | |
| 21 ArcPlayStoreSearchProvider(int max_results, | |
| 22 Profile* profile, | |
| 23 AppListControllerDelegate* list_controller); | |
| 24 ~ArcPlayStoreSearchProvider() override; | |
| 25 | |
| 26 protected: | |
| 27 // app_list::SearchProvider overrides: | |
| 28 void Start(bool is_voice_query, const base::string16& query) override; | |
| 29 void Stop() override; | |
| 30 | |
| 31 private: | |
| 32 void OnResults(std::vector<arc::mojom::AppDiscoveryResultPtr> results); | |
| 33 | |
| 34 const int max_results_; | |
| 35 // |profile_| is owned by ProfileInfo. | |
| 36 Profile* const profile_; | |
| 37 // list_controller_ is owned by AppListServiceAsh and lives | |
| 38 // until the service finishes. | |
| 39 AppListControllerDelegate* const list_controller_; | |
| 40 base::WeakPtrFactory<ArcPlayStoreSearchProvider> weak_ptr_factory_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(ArcPlayStoreSearchProvider); | |
| 43 }; | |
| 44 | |
| 45 } // namespace app_list | |
| 46 | |
| 47 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_ARC_ARC_PLAYSTORE_SEARCH_PROVIDER_H
_ | |
| OLD | NEW |