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

Side by Side Diff: chrome/browser/ui/app_list/search/arc/arc_playstore_search_result.h

Issue 2929273002: Add the Play Store app search to the launcher. (Closed)
Patch Set: Reuse context menu. 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 unified diff | Download patch
OLDNEW
(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_RESULT_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_ARC_ARC_PLAYSTORE_SEARCH_RESULT_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "base/optional.h"
13 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
14 #include "components/arc/common/app.mojom.h"
15 #include "ui/app_list/search_result.h"
16
17 class AppListControllerDelegate;
18 class ArcPlayStoreAppContextMenu;
19 class Profile;
20
21 namespace app_list {
22
23 class ArcPlayStoreSearchResult : public SearchResult,
24 public AppContextMenuDelegate {
25 public:
26 ArcPlayStoreSearchResult(arc::mojom::AppDiscoveryResultPtr data,
27 Profile* profile,
28 AppListControllerDelegate* list_controller_);
29 ~ArcPlayStoreSearchResult() override;
30
31 // app_list::SearchResult overrides:
32 std::unique_ptr<SearchResult> Duplicate() const override;
33
34 // app_list::AppContextMenuDelegate overrides:
35 ui::MenuModel* GetContextMenuModel() override;
36 void Open(int event_flags) override;
37 void ExecuteLaunchCommand(int event_flags) override;
38
39 private:
40 class IconDecodeRequest;
41
42 const base::Optional<std::string>& launch_intent_uri() const {
dcheng 2017/06/24 00:16:47 Are these getters used?
Jiaquan He 2017/06/24 00:48:08 Not all of them are used at this moment, but we'll
dcheng 2017/06/24 00:58:28 It's generally nicer to add code when it's actuall
43 return data_->launch_intent_uri;
44 }
45 const base::Optional<std::string>& install_intent_uri() const {
46 return data_->install_intent_uri;
47 }
48 const base::Optional<std::string>& label() const { return data_->label; }
49 bool is_instant_app() const { return data_->is_instant_app; }
50 bool is_recent() const { return data_->is_recent; }
51 const base::Optional<std::string>& publisher_name() const {
52 return data_->publisher_name;
53 }
54 const base::Optional<std::string>& formatted_price() const {
55 return data_->formatted_price;
56 }
57 float review_score() const { return data_->review_score; }
58 const std::vector<uint8_t>& icon_png_data() const {
59 return data_->icon_png_data;
60 }
61
62 arc::mojom::AppDiscoveryResultPtr data_;
63 std::unique_ptr<IconDecodeRequest> icon_decode_request_;
64
65 // |profile_| is owned by ProfileInfo.
66 Profile* const profile_;
67 // |list_controller_| is owned by AppListServiceAsh and lives
68 // until the service finishes.
69 AppListControllerDelegate* const list_controller_;
70 std::unique_ptr<ArcPlayStoreAppContextMenu> context_menu_;
71
72 DISALLOW_COPY_AND_ASSIGN(ArcPlayStoreSearchResult);
73 };
74
75 } // namespace app_list
76
77 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_ARC_ARC_PLAYSTORE_SEARCH_RESULT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698