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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 // static | 151 // static |
152 void LoginUtils::Set(LoginUtils* mock) { | 152 void LoginUtils::Set(LoginUtils* mock) { |
153 LoginUtilsWrapper::GetInstance()->reset(mock); | 153 LoginUtilsWrapper::GetInstance()->reset(mock); |
154 } | 154 } |
155 | 155 |
156 // static | 156 // static |
157 bool LoginUtils::IsWhitelisted(const std::string& username, | 157 bool LoginUtils::IsWhitelisted(const std::string& username, |
158 bool* wildcard_match) { | 158 bool* wildcard_match) { |
159 // Skip whitelist check for tests. | 159 // Skip whitelist check for tests. |
160 if (CommandLine::ForCurrentProcess()->HasSwitch( | 160 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
161 chromeos::switches::kOobeSkipPostLogin)) { | 161 chromeos::switches::kOobeSkipPostLogin)) { |
162 return true; | 162 return true; |
163 } | 163 } |
164 | 164 |
165 CrosSettings* cros_settings = CrosSettings::Get(); | 165 CrosSettings* cros_settings = CrosSettings::Get(); |
166 bool allow_new_user = false; | 166 bool allow_new_user = false; |
167 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 167 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
168 if (allow_new_user) | 168 if (allow_new_user) |
169 return true; | 169 return true; |
170 return cros_settings->FindEmailInList( | 170 return cros_settings->FindEmailInList( |
171 kAccountsPrefUsers, username, wildcard_match); | 171 kAccountsPrefUsers, username, wildcard_match); |
172 } | 172 } |
173 | 173 |
174 } // namespace chromeos | 174 } // namespace chromeos |
OLD | NEW |