OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/user_manager/user.h" | 5 #include "components/user_manager/user.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 } | 301 } |
302 | 302 |
303 PublicAccountUser::~PublicAccountUser() { | 303 PublicAccountUser::~PublicAccountUser() { |
304 } | 304 } |
305 | 305 |
306 UserType PublicAccountUser::GetType() const { | 306 UserType PublicAccountUser::GetType() const { |
307 return user_manager::USER_TYPE_PUBLIC_ACCOUNT; | 307 return user_manager::USER_TYPE_PUBLIC_ACCOUNT; |
308 } | 308 } |
309 | 309 |
310 bool User::has_gaia_account() const { | 310 bool User::has_gaia_account() const { |
311 COMPILE_ASSERT(user_manager::NUM_USER_TYPES == 7, num_user_types_unexpected); | 311 static_assert(user_manager::NUM_USER_TYPES == 7, |
| 312 "NUM_USER_TYPES should equal 7"); |
312 switch (GetType()) { | 313 switch (GetType()) { |
313 case user_manager::USER_TYPE_REGULAR: | 314 case user_manager::USER_TYPE_REGULAR: |
314 case user_manager::USER_TYPE_CHILD: | 315 case user_manager::USER_TYPE_CHILD: |
315 return true; | 316 return true; |
316 case user_manager::USER_TYPE_GUEST: | 317 case user_manager::USER_TYPE_GUEST: |
317 case user_manager::USER_TYPE_PUBLIC_ACCOUNT: | 318 case user_manager::USER_TYPE_PUBLIC_ACCOUNT: |
318 case user_manager::USER_TYPE_SUPERVISED: | 319 case user_manager::USER_TYPE_SUPERVISED: |
319 case user_manager::USER_TYPE_KIOSK_APP: | 320 case user_manager::USER_TYPE_KIOSK_APP: |
320 return false; | 321 return false; |
321 default: | 322 default: |
322 NOTREACHED(); | 323 NOTREACHED(); |
323 } | 324 } |
324 return false; | 325 return false; |
325 } | 326 } |
326 | 327 |
327 } // namespace user_manager | 328 } // namespace user_manager |
OLD | NEW |