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

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: Implement methods in FakeAppInstance. 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 <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 "ui/app_list/search_result.h"
15
16 class AppListControllerDelegate;
17 class PlayStoreAppContextMenu;
18 class Profile;
19
20 namespace app_list {
21
22 class PlayStoreSearchResult : public SearchResult,
23 public AppContextMenuDelegate {
24 public:
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 Profile* const profile,
Luis Héctor Chávez 2017/06/23 15:17:03 It's not customary to add '* const' to pointers in
Jiaquan He 2017/06/23 16:26:27 Done.
35 AppListControllerDelegate* const list_controller_);
36 ~PlayStoreSearchResult() override;
37
38 // app_list::SearchResult overrides:
39 std::unique_ptr<SearchResult> Duplicate() const override;
40
41 // app_list::AppContextMenuDelegate overrides:
42 ui::MenuModel* GetContextMenuModel() override;
43 void Open(int event_flags) override;
44 void ExecuteLaunchCommand(int event_flags) override;
45
46 private:
47 class IconDecodeRequest;
48
49 const base::Optional<std::string> launch_intent_uri_;
50 const base::Optional<std::string> install_intent_uri_;
51 const base::Optional<std::string> label_;
52 const bool is_instant_app_;
53 const bool is_recent_;
54 const base::Optional<std::string> publisher_name_;
55 const base::Optional<std::string> formatted_price_;
56 const float review_score_;
57 const std::vector<uint8_t> icon_png_data_;
58
59 std::unique_ptr<IconDecodeRequest> icon_decode_request_;
60
61 // |profile_| is owned by ProfileInfo.
62 Profile* const profile_;
63 // |list_controller_| is owned by AppListServiceAsh and lives
64 // until the service finishes.
65 AppListControllerDelegate* const list_controller_;
66 std::unique_ptr<PlayStoreAppContextMenu> context_menu_;
67
68 base::WeakPtrFactory<PlayStoreSearchResult> weak_ptr_factory_;
69
70 DISALLOW_COPY_AND_ASSIGN(PlayStoreSearchResult);
71 };
72
73 } // namespace app_list
74
75 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_RESULT_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698