OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_ | 5 #ifndef ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_ |
6 #define ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_ | 6 #define ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_ |
7 | 7 |
8 #include "ash/public/cpp/session_types.h" | 8 #include "ash/public/cpp/session_types.h" |
9 #include "ash/public/interfaces/session_controller.mojom.h" | 9 #include "ash/public/interfaces/session_controller.mojom.h" |
10 #include "components/session_manager/session_manager_types.h" | 10 #include "components/session_manager/session_manager_types.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 return true; | 158 return true; |
159 case ash::mojom::AddUserSessionPolicy::ERROR_MAXIMUM_USERS_REACHED: | 159 case ash::mojom::AddUserSessionPolicy::ERROR_MAXIMUM_USERS_REACHED: |
160 *out = ash::AddUserSessionPolicy::ERROR_MAXIMUM_USERS_REACHED; | 160 *out = ash::AddUserSessionPolicy::ERROR_MAXIMUM_USERS_REACHED; |
161 return true; | 161 return true; |
162 } | 162 } |
163 NOTREACHED(); | 163 NOTREACHED(); |
164 return false; | 164 return false; |
165 } | 165 } |
166 }; | 166 }; |
167 | 167 |
| 168 template <> |
| 169 struct EnumTraits<ash::mojom::CycleUserDirection, ash::CycleUserDirection> { |
| 170 static ash::mojom::CycleUserDirection ToMojom(ash::CycleUserDirection input) { |
| 171 switch (input) { |
| 172 case ash::CycleUserDirection::NEXT: |
| 173 return ash::mojom::CycleUserDirection::NEXT; |
| 174 case ash::CycleUserDirection::PREVIOUS: |
| 175 return ash::mojom::CycleUserDirection::PREVIOUS; |
| 176 } |
| 177 NOTREACHED(); |
| 178 return ash::mojom::CycleUserDirection::NEXT; |
| 179 } |
| 180 |
| 181 static bool FromMojom(ash::mojom::CycleUserDirection input, |
| 182 ash::CycleUserDirection* out) { |
| 183 switch (input) { |
| 184 case ash::mojom::CycleUserDirection::NEXT: |
| 185 *out = ash::CycleUserDirection::NEXT; |
| 186 return true; |
| 187 case ash::mojom::CycleUserDirection::PREVIOUS: |
| 188 *out = ash::CycleUserDirection::PREVIOUS; |
| 189 return true; |
| 190 } |
| 191 NOTREACHED(); |
| 192 return false; |
| 193 } |
| 194 }; |
| 195 |
168 } // namespace mojo | 196 } // namespace mojo |
169 | 197 |
170 #endif // ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_ | 198 #endif // ASH_PUBLIC_INTERFACES_SESSION_CONTROLLER_TRAITS_H_ |
OLD | NEW |