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

Unified Diff: chrome/browser/chromeos/settings/cros_settings.cc

Issue 745613002: [cros] Cleanup: remove LoginUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get rid of FakeChromeUserManager usage in ExistingUserController* tests Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/cros_settings.cc
diff --git a/chrome/browser/chromeos/settings/cros_settings.cc b/chrome/browser/chromeos/settings/cros_settings.cc
index 96427d23116413128ad79a0fae00779608dec10e..016b33a5ce0be0e84813a2d53273e96651a3d929 100644
--- a/chrome/browser/chromeos/settings/cros_settings.cc
+++ b/chrome/browser/chromeos/settings/cros_settings.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/chromeos/settings/stub_cros_settings_provider.h"
#include "chrome/browser/chromeos/settings/system_settings_provider.h"
#include "chromeos/chromeos_switches.h"
+#include "chromeos/settings/cros_settings_names.h"
#include "google_apis/gaia/gaia_auth_util.h"
namespace chromeos {
@@ -45,6 +46,24 @@ CrosSettings* CrosSettings::Get() {
return g_cros_settings;
}
+// static
+bool CrosSettings::IsWhitelisted(const std::string& username,
+ bool* wildcard_match) {
+ // Skip whitelist check for tests.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kOobeSkipPostLogin)) {
+ return true;
+ }
+
+ CrosSettings* cros_settings = CrosSettings::Get();
+ bool allow_new_user = false;
+ cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
+ if (allow_new_user)
+ return true;
+ return cros_settings->FindEmailInList(kAccountsPrefUsers, username,
+ wildcard_match);
+}
+
CrosSettings::CrosSettings(DeviceSettingsService* device_settings_service) {
CrosSettingsProvider::NotifyObserversCallback notify_cb(
base::Bind(&CrosSettings::FireObservers,
« no previous file with comments | « chrome/browser/chromeos/settings/cros_settings.h ('k') | chrome/browser/chromeos/system/tray_accessibility_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698