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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 819133004: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 (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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698