Chromium Code Reviews| Index: chrome/browser/ui/app_list/search/playstore/playstore_search_result.h |
| diff --git a/chrome/browser/ui/app_list/search/playstore/playstore_search_result.h b/chrome/browser/ui/app_list/search/playstore/playstore_search_result.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c54476ad04191638fccfebe6c6f8c74fc99563f8 |
| --- /dev/null |
| +++ b/chrome/browser/ui/app_list/search/playstore/playstore_search_result.h |
| @@ -0,0 +1,75 @@ |
| +// 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_RESULT_H_ |
| +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_RESULT_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/optional.h" |
| +#include "chrome/browser/ui/app_list/app_context_menu_delegate.h" |
| +#include "ui/app_list/search_result.h" |
| + |
| +class AppListControllerDelegate; |
| +class PlayStoreAppContextMenu; |
| +class Profile; |
| + |
| +namespace app_list { |
| + |
| +class PlayStoreSearchResult : public SearchResult, |
| + public AppContextMenuDelegate { |
| + public: |
| + PlayStoreSearchResult(const base::Optional<std::string>& launch_intent_uri, |
| + const base::Optional<std::string>& install_intent_uri, |
| + const base::Optional<std::string>& label, |
| + bool is_instant_app, |
| + bool is_recent, |
| + const base::Optional<std::string>& publisher_name, |
| + const base::Optional<std::string>& formatted_price, |
| + float review_score, |
| + const std::vector<uint8_t>& icon_png_data, |
| + 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.
|
| + AppListControllerDelegate* const list_controller_); |
| + ~PlayStoreSearchResult() override; |
| + |
| + // app_list::SearchResult overrides: |
| + std::unique_ptr<SearchResult> Duplicate() const override; |
| + |
| + // app_list::AppContextMenuDelegate overrides: |
| + ui::MenuModel* GetContextMenuModel() override; |
| + void Open(int event_flags) override; |
| + void ExecuteLaunchCommand(int event_flags) override; |
| + |
| + private: |
| + class IconDecodeRequest; |
| + |
| + const base::Optional<std::string> launch_intent_uri_; |
| + const base::Optional<std::string> install_intent_uri_; |
| + const base::Optional<std::string> label_; |
| + const bool is_instant_app_; |
| + const bool is_recent_; |
| + const base::Optional<std::string> publisher_name_; |
| + const base::Optional<std::string> formatted_price_; |
| + const float review_score_; |
| + const std::vector<uint8_t> icon_png_data_; |
| + |
| + std::unique_ptr<IconDecodeRequest> icon_decode_request_; |
| + |
| + // |profile_| is owned by ProfileInfo. |
| + Profile* const profile_; |
| + // |list_controller_| is owned by AppListServiceAsh and lives |
| + // until the service finishes. |
| + AppListControllerDelegate* const list_controller_; |
| + std::unique_ptr<PlayStoreAppContextMenu> context_menu_; |
| + |
| + base::WeakPtrFactory<PlayStoreSearchResult> weak_ptr_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PlayStoreSearchResult); |
| +}; |
| + |
| +} // namespace app_list |
| + |
| +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_PLAYSTORE_SEARCH_RESULT_H_ |