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 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_MOJO_APP_DISCOVERY_RESULT_TR
AITS_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_MOJO_APP_DISCOVERY_RESULT_TR
AITS_H_ |
| 7 |
| 8 #include "chrome/browser/ui/app_list/search/playstore/playstore_search_result.h" |
| 9 #include "components/arc/common/app.mojom.h" |
| 10 #include "mojo/public/cpp/bindings/struct_traits.h" |
| 11 |
| 12 namespace mojo { |
| 13 |
| 14 template <> |
| 15 struct StructTraits<arc::mojom::AppDiscoveryResultDataView, |
| 16 app_list::PlayStoreSearchResultUniquePtr> { |
| 17 public: |
| 18 static const base::Optional<std::string>& launch_intent_uri( |
| 19 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 20 return r->launch_intent_uri(); |
| 21 } |
| 22 static const base::Optional<std::string>& install_intent_uri( |
| 23 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 24 return r->install_intent_uri(); |
| 25 } |
| 26 static const base::Optional<std::string>& label( |
| 27 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 28 return r->label(); |
| 29 } |
| 30 static bool is_instant_app( |
| 31 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 32 return r->is_instant_app(); |
| 33 } |
| 34 static bool is_recent(const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 35 return r->is_recent(); |
| 36 } |
| 37 static const base::Optional<std::string>& publisher_name( |
| 38 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 39 return r->publisher_name(); |
| 40 } |
| 41 static const base::Optional<std::string>& formatted_price( |
| 42 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 43 return r->formatted_price(); |
| 44 } |
| 45 static float review_score(const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 46 return r->review_score(); |
| 47 } |
| 48 static const std::vector<uint8_t>& icon_png_data( |
| 49 const app_list::PlayStoreSearchResultUniquePtr& r) { |
| 50 return r->icon_png_data(); |
| 51 } |
| 52 |
| 53 static bool Read(arc::mojom::AppDiscoveryResultDataView data, |
| 54 app_list::PlayStoreSearchResultUniquePtr* out); |
| 55 }; |
| 56 |
| 57 } // namespace mojo |
| 58 |
| 59 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_PLAYSTORE_MOJO_APP_DISCOVERY_RESULT
_TRAITS_H_ |
OLD | NEW |