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

Unified Diff: ash/public/cpp/shelf_struct_traits.h

Issue 2860503002: mash: Replace int ShelfIDs with AppLaunchID strings. (Closed)
Patch Set: Fix struct traits typo. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/public/cpp/shelf_item_delegate.cc ('k') | ash/public/cpp/shelf_struct_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/public/cpp/shelf_struct_traits.h
diff --git a/ash/public/cpp/shelf_struct_traits.h b/ash/public/cpp/shelf_struct_traits.h
index b2d472302c91e46cd1347dd3625f66470c819979..532be621478b44dfc47c9e61b77e3d038c605e47 100644
--- a/ash/public/cpp/shelf_struct_traits.h
+++ b/ash/public/cpp/shelf_struct_traits.h
@@ -255,17 +255,21 @@ struct EnumTraits<ash::mojom::ShelfLaunchSource, ash::ShelfLaunchSource> {
template <>
struct ASH_PUBLIC_EXPORT
+ StructTraits<ash::mojom::ShelfIDDataView, ash::ShelfID> {
+ static const std::string& app_id(const ash::ShelfID& i) { return i.app_id; }
+ static const std::string& launch_id(const ash::ShelfID& i) {
+ return i.launch_id;
+ }
+ static bool Read(ash::mojom::ShelfIDDataView data, ash::ShelfID* out);
+};
+
+template <>
+struct ASH_PUBLIC_EXPORT
StructTraits<ash::mojom::ShelfItemDataView, ShelfItem> {
static ash::ShelfItemType type(const ShelfItem& i) { return i.type; }
static const SkBitmap& image(const ShelfItem& i);
- static ash::ShelfID shelf_id(const ShelfItem& i) { return i.id; }
static ash::ShelfItemStatus status(const ShelfItem& i) { return i.status; }
- static const std::string& app_id(const ShelfItem& i) {
- return i.app_launch_id.app_id();
- }
- static const std::string& launch_id(const ShelfItem& i) {
- return i.app_launch_id.launch_id();
- }
+ static const ash::ShelfID& shelf_id(const ShelfItem& i) { return i.id; }
static const base::string16& title(const ShelfItem& i) { return i.title; }
static bool shows_tooltip(const ShelfItem& i) { return i.shows_tooltip; }
static bool pinned_by_policy(const ShelfItem& i) {
« no previous file with comments | « ash/public/cpp/shelf_item_delegate.cc ('k') | ash/public/cpp/shelf_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698