OLD | NEW |
(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 #include "chrome/browser/ui/app_list/search/playstore/mojo/app_discovery_result_
traits.h" |
| 6 |
| 7 namespace mojo { |
| 8 |
| 9 bool StructTraits<arc::mojom::AppDiscoveryResultDataView, |
| 10 app_list::PlayStoreSearchResultUniquePtr>:: |
| 11 Read(arc::mojom::AppDiscoveryResultDataView data, |
| 12 app_list::PlayStoreSearchResultUniquePtr* out) { |
| 13 base::Optional<std::string> launch_intent_uri; |
| 14 if (!data.ReadLaunchIntentUri(&launch_intent_uri)) |
| 15 return false; |
| 16 |
| 17 base::Optional<std::string> install_intent_uri; |
| 18 if (!data.ReadInstallIntentUri(&install_intent_uri)) |
| 19 return false; |
| 20 |
| 21 base::Optional<std::string> label; |
| 22 if (!data.ReadLabel(&label)) |
| 23 return false; |
| 24 |
| 25 base::Optional<std::string> publisher_name; |
| 26 if (!data.ReadPublisherName(&publisher_name)) |
| 27 return false; |
| 28 |
| 29 base::Optional<std::string> formatted_price; |
| 30 if (!data.ReadFormattedPrice(&formatted_price)) |
| 31 return false; |
| 32 |
| 33 std::vector<uint8_t> icon_png_data; |
| 34 if (!data.ReadIconPngData(&icon_png_data)) |
| 35 return false; |
| 36 |
| 37 *out = base::MakeUnique<app_list::PlayStoreSearchResult>( |
| 38 std::move(launch_intent_uri), std::move(install_intent_uri), |
| 39 std::move(label), data.is_instant_app(), data.is_recent(), |
| 40 std::move(publisher_name), std::move(formatted_price), |
| 41 data.review_score(), std::move(icon_png_data)); |
| 42 return true; |
| 43 } |
| 44 |
| 45 } // namespace mojo |
OLD | NEW |