| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 LoginUtils* LoginUtils::Get() { | 885 LoginUtils* LoginUtils::Get() { |
| 886 return LoginUtilsWrapper::GetInstance()->get(); | 886 return LoginUtilsWrapper::GetInstance()->get(); |
| 887 } | 887 } |
| 888 | 888 |
| 889 // static | 889 // static |
| 890 void LoginUtils::Set(LoginUtils* mock) { | 890 void LoginUtils::Set(LoginUtils* mock) { |
| 891 LoginUtilsWrapper::GetInstance()->reset(mock); | 891 LoginUtilsWrapper::GetInstance()->reset(mock); |
| 892 } | 892 } |
| 893 | 893 |
| 894 // static | 894 // static |
| 895 bool LoginUtils::IsWhitelisted(const std::string& username) { | 895 bool LoginUtils::IsWhitelisted(const std::string& username, |
| 896 bool* wildcard_match) { |
| 896 // Skip whitelist check for tests. | 897 // Skip whitelist check for tests. |
| 897 if (CommandLine::ForCurrentProcess()->HasSwitch( | 898 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 898 chromeos::switches::kOobeSkipPostLogin)) { | 899 chromeos::switches::kOobeSkipPostLogin)) { |
| 899 return true; | 900 return true; |
| 900 } | 901 } |
| 901 | 902 |
| 902 CrosSettings* cros_settings = CrosSettings::Get(); | 903 CrosSettings* cros_settings = CrosSettings::Get(); |
| 903 bool allow_new_user = false; | 904 bool allow_new_user = false; |
| 904 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 905 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
| 905 if (allow_new_user) | 906 if (allow_new_user) |
| 906 return true; | 907 return true; |
| 907 return cros_settings->FindEmailInList(kAccountsPrefUsers, username); | 908 return cros_settings->FindEmailInList( |
| 909 kAccountsPrefUsers, username, wildcard_match); |
| 908 } | 910 } |
| 909 | 911 |
| 910 } // namespace chromeos | 912 } // namespace chromeos |
| OLD | NEW |