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

Side by Side Diff: chrome/browser/ui/app_list/search/playstore/playstore_search_result.h

Issue 2929273002: Add the Play Store app search to the launcher. (Closed)
Patch Set: Finished comments and merged with the context menu CL. 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_PLAYSTORE_PLAYSTORE_SEARCH_RESULT_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_RESULT_H_
7
8 #include "base/optional.h"
9 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
10 #include "ui/app_list/search_result.h"
11
12 #if defined(OS_CHROMEOS)
Luis Héctor Chávez 2017/06/22 15:42:10 Remove. Move this #if to where you are including i
Jiaquan He 2017/06/22 19:12:41 Done.
13
14 class AppListControllerDelegate;
15 class PlayStoreAppContextMenu;
16 class Profile;
17
18 namespace app_list {
19
20 class PlayStoreSearchResult : public SearchResult,
21 public AppContextMenuDelegate {
22 public:
23 // app_list::SearchResult overrides:
Luis Héctor Chávez 2017/06/22 15:42:10 Move this to after L34. The ctors/dtor are typical
Jiaquan He 2017/06/22 19:12:41 Done.
24 PlayStoreSearchResult();
Luis Héctor Chávez 2017/06/22 15:42:10 Why do you need this constructor?
Jiaquan He 2017/06/22 19:12:41 Done.
25 PlayStoreSearchResult(const base::Optional<std::string>& launch_intent_uri,
26 const base::Optional<std::string>& install_intent_uri,
27 const base::Optional<std::string>& label,
28 bool is_instant_app,
29 bool is_recent,
30 const base::Optional<std::string>& publisher_name,
31 const base::Optional<std::string>& formatted_price,
32 float review_score,
33 const std::vector<uint8_t>& icon_png_data);
34 ~PlayStoreSearchResult() override;
35 std::unique_ptr<SearchResult> Duplicate() const override;
36 ui::MenuModel* GetContextMenuModel() override;
37 void ExecuteLaunchCommand(int event_flags) override;
Luis Héctor Chávez 2017/06/22 15:42:10 Move this to after L39 and add an overrides: comme
Jiaquan He 2017/06/22 19:12:42 Done.
38 void Open(int event_flags) override;
39
40 const base::Optional<std::string>& launch_intent_uri() const {
41 return launch_intent_uri_;
42 }
43
44 const base::Optional<std::string>& install_intent_uri() const {
45 return install_intent_uri_;
46 }
47
48 const base::Optional<std::string>& label() const { return label_; }
49
50 bool is_instant_app() const { return is_instant_app_; }
51
52 bool is_recent() const { return is_recent_; }
53
54 const base::Optional<std::string>& publisher_name() const {
55 return publisher_name_;
56 }
57
58 const base::Optional<std::string>& formatted_price() const {
59 return formatted_price_;
60 }
61
62 float review_score() const { return review_score_; }
63
64 const std::vector<uint8_t>& icon_png_data() const { return icon_png_data_; }
65
66 void set_profile(Profile* profile) { profile_ = profile; }
67 Profile* profile() const { return profile_; }
68
69 void set_list_controller(AppListControllerDelegate* list_controller) {
70 list_controller_ = list_controller;
71 }
72 AppListControllerDelegate* list_controller() const {
73 return list_controller_;
74 }
75
76 private:
77 class IconSource;
Luis Héctor Chávez 2017/06/22 15:42:10 You are not referring to IconSource anywhere in th
Jiaquan He 2017/06/22 19:12:41 Done.
78 class IconDecodeRequest;
79
80 const base::Optional<std::string> launch_intent_uri_;
81 const base::Optional<std::string> install_intent_uri_;
82 const base::Optional<std::string> label_;
83 const bool is_instant_app_;
84 const bool is_recent_;
85 const base::Optional<std::string> publisher_name_;
86 const base::Optional<std::string> formatted_price_;
87 const float review_score_;
88 const std::vector<uint8_t> icon_png_data_;
89
90 std::unique_ptr<IconDecodeRequest> icon_decode_request_;
91
92 // profile_ is ownd by ProfileInfo.
Luis Héctor Chávez 2017/06/22 15:42:10 nit: |profile_| is owned
Jiaquan He 2017/06/22 19:12:42 Done.
93 Profile* profile_;
94 // list_controller_ is owned by AppListServiceAsh and lives
Luis Héctor Chávez 2017/06/22 15:42:10 nit: |list_controller_|
Jiaquan He 2017/06/22 19:12:41 Done.
95 // until the service finishes.
96 AppListControllerDelegate* list_controller_;
97 std::unique_ptr<PlayStoreAppContextMenu> context_menu_;
98
99 base::WeakPtrFactory<PlayStoreSearchResult> weak_ptr_factory_;
100
101 DISALLOW_COPY_AND_ASSIGN(PlayStoreSearchResult);
102 };
103
104 using PlayStoreSearchResultUniquePtr = std::unique_ptr<PlayStoreSearchResult>;
Luis Héctor Chávez 2017/06/22 15:42:10 remove
Jiaquan He 2017/06/22 19:12:41 Done.
105
106 } // namespace app_list
107
108 #endif
109
110 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_RESULT_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698