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

Unified Diff: ash/public/interfaces/session_controller_traits.h

Issue 2724163002: ash: Use enum for SessionController::CycleActiveUser (Closed)
Patch Set: Created 3 years, 10 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
Index: ash/public/interfaces/session_controller_traits.h
diff --git a/ash/public/interfaces/session_controller_traits.h b/ash/public/interfaces/session_controller_traits.h
index 059420da820bfb7e5c8cfae7140280b1ea832af6..91034d1d61df506b8913ba2d684f0f31ba7eab23 100644
--- a/ash/public/interfaces/session_controller_traits.h
+++ b/ash/public/interfaces/session_controller_traits.h
@@ -165,6 +165,33 @@ struct EnumTraits<ash::mojom::AddUserSessionPolicy, ash::AddUserSessionPolicy> {
}
};
+template <>
+struct EnumTraits<ash::mojom::CycleUser, ash::CycleUser> {
+ static ash::mojom::CycleUser ToMojom(ash::CycleUser input) {
+ switch (input) {
+ case ash::CycleUser::CYCLE_TO_NEXT_USER:
+ return ash::mojom::CycleUser::CYCLE_TO_NEXT_USER;
+ case ash::CycleUser::CYCLE_TO_PREVIOUS_USER:
+ return ash::mojom::CycleUser::CYCLE_TO_PREVIOUS_USER;
+ }
+ NOTREACHED();
+ return ash::mojom::CycleUser::CYCLE_TO_NEXT_USER;
+ }
+
+ static bool FromMojom(ash::mojom::CycleUser input, ash::CycleUser* out) {
+ switch (input) {
+ case ash::mojom::CycleUser::CYCLE_TO_NEXT_USER:
+ *out = ash::CycleUser::CYCLE_TO_NEXT_USER;
+ return true;
+ case ash::mojom::CycleUser::CYCLE_TO_PREVIOUS_USER:
+ *out = ash::CycleUser::CYCLE_TO_PREVIOUS_USER;
+ return true;
+ }
+ NOTREACHED();
+ return false;
+ }
+};
+
} // namespace mojo
#endif // ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_

Powered by Google App Engine
This is Rietveld 408576698