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

Side by Side Diff: components/user_manager/user.cc

Issue 794683005: replace COMPILE_ASSERT with static_assert in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting fixup Created 6 years 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/translate/core/common/translate_metrics.cc ('k') | components/variations/entropy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698