Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: chrome/browser/ui/app_list/search/playstore/playstore_search_provider.h

Issue 2929273002: Add the Play Store app search to the launcher. (Closed)
Patch Set: Resolve Luis comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/search/playstore/playstore_search_provider.h
diff --git a/chrome/browser/ui/app_list/search/playstore/playstore_search_provider.h b/chrome/browser/ui/app_list/search/playstore/playstore_search_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..53fd13214c8196d3f3bc272341b1a75df4945a04
--- /dev/null
+++ b/chrome/browser/ui/app_list/search/playstore/playstore_search_provider.h
@@ -0,0 +1,47 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_PROVIDER_H_
+#define CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_PROVIDER_H_
+
+#include <memory>
+#include <vector>
+
+#include "components/arc/common/app.mojom.h"
+#include "ui/app_list/search_provider.h"
+
+class Profile;
+class AppListControllerDelegate;
+
+namespace app_list {
+
+class PlayStoreSearchProvider : public SearchProvider {
+ public:
+ PlayStoreSearchProvider(int max_results,
+ Profile* profile,
+ AppListControllerDelegate* list_controller);
+ ~PlayStoreSearchProvider() override;
+
+ protected:
+ // app_list::SearchProvider overrides;
+ void Start(bool is_voice_query, const base::string16& query) override;
+ void Stop() override;
+
+ private:
+ void OnResults(std::vector<std::unique_ptr<PlayStoreSearchResult>> results);
+
+ const int max_results_;
+ // |profile_| is owned by ProfileInfo.
+ Profile* const profile_;
+ // list_controller_ is owned by AppListServiceAsh and lives
+ // until the service finishes.
+ AppListControllerDelegate* const list_controller_;
+ base::WeakPtrFactory<PlayStoreSearchProvider> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PlayStoreSearchProvider);
+};
+
+} // namespace app_list
+
+#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698