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

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

Issue 148843002: Make an online wildcard login check for enterprise devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 10 months 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 | Annotate | Revision Log
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 <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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/login_utils.h ('k') | chrome/browser/chromeos/policy/policy_oauth2_token_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698