Index: ash/public/interfaces/shelf_struct_traits.h |
diff --git a/ash/public/interfaces/shelf_struct_traits.h b/ash/public/interfaces/shelf_struct_traits.h |
index 50dbdaeb79d9621182da00c77cf6ecca66a4f404..74c0a7cdcfa6246b8c96aaaebf3a7cb55fa47753 100644 |
--- a/ash/public/interfaces/shelf_struct_traits.h |
+++ b/ash/public/interfaces/shelf_struct_traits.h |
@@ -11,6 +11,48 @@ |
namespace mojo { |
template <> |
+struct EnumTraits<ash::mojom::ShelfAction, ash::ShelfAction> { |
+ static ash::mojom::ShelfAction ToMojom(ash::ShelfAction input) { |
+ switch (input) { |
+ case ash::SHELF_ACTION_NONE: |
+ return ash::mojom::ShelfAction::NONE; |
+ case ash::SHELF_ACTION_NEW_WINDOW_CREATED: |
+ return ash::mojom::ShelfAction::WINDOW_CREATED; |
+ case ash::SHELF_ACTION_WINDOW_ACTIVATED: |
+ return ash::mojom::ShelfAction::WINDOW_ACTIVATED; |
+ case ash::SHELF_ACTION_WINDOW_MINIMIZED: |
+ return ash::mojom::ShelfAction::WINDOW_MINIMIZED; |
+ case ash::SHELF_ACTION_APP_LIST_SHOWN: |
+ return ash::mojom::ShelfAction::APP_LIST_SHOWN; |
+ } |
+ NOTREACHED(); |
+ return ash::mojom::ShelfAction::NONE; |
+ } |
+ |
+ static bool FromMojom(ash::mojom::ShelfAction input, ash::ShelfAction* out) { |
+ switch (input) { |
+ case ash::mojom::ShelfAction::NONE: |
+ *out = ash::SHELF_ACTION_NONE; |
+ return true; |
+ case ash::mojom::ShelfAction::WINDOW_CREATED: |
+ *out = ash::SHELF_ACTION_NEW_WINDOW_CREATED; |
+ return true; |
+ case ash::mojom::ShelfAction::WINDOW_ACTIVATED: |
+ *out = ash::SHELF_ACTION_WINDOW_ACTIVATED; |
+ return true; |
+ case ash::mojom::ShelfAction::WINDOW_MINIMIZED: |
+ *out = ash::SHELF_ACTION_WINDOW_MINIMIZED; |
+ return true; |
+ case ash::mojom::ShelfAction::APP_LIST_SHOWN: |
+ *out = ash::SHELF_ACTION_APP_LIST_SHOWN; |
+ return true; |
+ } |
+ NOTREACHED(); |
+ return false; |
+ } |
+}; |
+ |
+template <> |
struct EnumTraits<ash::mojom::ShelfAlignment, ash::ShelfAlignment> { |
static ash::mojom::ShelfAlignment ToMojom(ash::ShelfAlignment input) { |
switch (input) { |
@@ -83,6 +125,39 @@ struct EnumTraits<ash::mojom::ShelfAutoHideBehavior, |
} |
}; |
+template <> |
+struct EnumTraits<ash::mojom::ShelfLaunchSource, ash::ShelfLaunchSource> { |
+ static ash::mojom::ShelfLaunchSource ToMojom(ash::ShelfLaunchSource input) { |
+ switch (input) { |
+ case ash::LAUNCH_FROM_UNKNOWN: |
+ return ash::mojom::ShelfLaunchSource::UNKNOWN; |
+ case ash::LAUNCH_FROM_APP_LIST: |
+ return ash::mojom::ShelfLaunchSource::APP_LIST; |
+ case ash::LAUNCH_FROM_APP_LIST_SEARCH: |
+ return ash::mojom::ShelfLaunchSource::APP_LIST_SEARCH; |
+ } |
+ NOTREACHED(); |
+ return ash::mojom::ShelfLaunchSource::UNKNOWN; |
+ } |
+ |
+ static bool FromMojom(ash::mojom::ShelfLaunchSource input, |
+ ash::ShelfLaunchSource* out) { |
+ switch (input) { |
+ case ash::mojom::ShelfLaunchSource::UNKNOWN: |
+ *out = ash::LAUNCH_FROM_UNKNOWN; |
+ return true; |
+ case ash::mojom::ShelfLaunchSource::APP_LIST: |
+ *out = ash::LAUNCH_FROM_APP_LIST; |
+ return true; |
+ case ash::mojom::ShelfLaunchSource::APP_LIST_SEARCH: |
+ *out = ash::LAUNCH_FROM_APP_LIST_SEARCH; |
+ return true; |
+ } |
+ NOTREACHED(); |
+ return false; |
+ } |
+}; |
+ |
} // namespace mojo |
#endif // ASH_PUBLIC_INTERFACES_SHELF_STRUCT_TRAITS_H_ |