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

Side by Side Diff: ash/public/interfaces/session_controller_traits.h

Issue 2724163002: ash: Use enum for SessionController::CycleActiveUser (Closed)
Patch Set: fix ash_shell_with_content compile Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ash/public/interfaces/session_controller.typemap ('k') | ash/shell/shell_delegate_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « ash/public/interfaces/session_controller.typemap ('k') | ash/shell/shell_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698