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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/accounts_options_handler.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/ui/webui/options/chromeos/accounts_options_handler.h" 5 #include "chrome/browser/ui/webui/options/chromeos/accounts_options_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 14 matching lines...) Expand all
25 #include "ui/base/l10n/l10n_util.h" 25 #include "ui/base/l10n/l10n_util.h"
26 26
27 namespace chromeos { 27 namespace chromeos {
28 28
29 namespace { 29 namespace {
30 30
31 // Adds specified user to the whitelist. Returns false if that user is already 31 // Adds specified user to the whitelist. Returns false if that user is already
32 // in the whitelist. 32 // in the whitelist.
33 bool WhitelistUser(const std::string& username) { 33 bool WhitelistUser(const std::string& username) {
34 CrosSettings* cros_settings = CrosSettings::Get(); 34 CrosSettings* cros_settings = CrosSettings::Get();
35 if (cros_settings->FindEmailInList(kAccountsPrefUsers, username)) 35 if (cros_settings->FindEmailInList(kAccountsPrefUsers, username, NULL))
36 return false; 36 return false;
37 base::StringValue username_value(username); 37 base::StringValue username_value(username);
38 cros_settings->AppendToList(kAccountsPrefUsers, &username_value); 38 cros_settings->AppendToList(kAccountsPrefUsers, &username_value);
39 return true; 39 return true;
40 } 40 }
41 41
42 } // namespace 42 } // namespace
43 43
44 namespace options { 44 namespace options {
45 45
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 const UserList& users = UserManager::Get()->GetUsers(); 133 const UserList& users = UserManager::Get()->GetUsers();
134 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it) 134 for (UserList::const_iterator it = users.begin(); it < users.end(); ++it)
135 new_list->AppendIfNotPresent(new base::StringValue((*it)->email())); 135 new_list->AppendIfNotPresent(new base::StringValue((*it)->email()));
136 136
137 cros_settings->Set(kAccountsPrefUsers, *new_list.get()); 137 cros_settings->Set(kAccountsPrefUsers, *new_list.get());
138 } 138 }
139 139
140 } // namespace options 140 } // namespace options
141 } // namespace chromeos 141 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/cros_settings_unittest.cc ('k') | chrome/chrome_browser_chromeos.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698