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

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

Issue 8091002: PART2: Make SignedSettings use proper Value types instead of string all around the place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and fixed an issue with user whitelist checks. Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_performer.h" 5 #include "chrome/browser/chromeos/login/login_performer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 } 275 }
276 276
277 bool allow_new_user = false; 277 bool allow_new_user = false;
278 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 278 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
279 if (ScreenLocker::default_screen_locker() || allow_new_user) { 279 if (ScreenLocker::default_screen_locker() || allow_new_user) {
280 // Starts authentication if guest login is allowed or online auth pending. 280 // Starts authentication if guest login is allowed or online auth pending.
281 StartLoginCompletion(); 281 StartLoginCompletion();
282 } else { 282 } else {
283 // Otherwise, do whitelist check first. 283 // Otherwise, do whitelist check first.
284 const base::ListValue *user_list; 284 if (cros_settings->FindEmailInList(kAccountsPrefUsers, username)) {
Mattias Nissler (ping if slow) 2011/10/28 14:44:07 why has this worked before if we didn't check *@do
pastarmovj 2011/11/18 13:18:42 Because there is some code that whitelists existin
285 base::StringValue username_value(username);
286 if (cros_settings->GetList(kAccountsPrefUsers, &user_list) &&
287 user_list->Find(username_value) != user_list->end()) {
288 StartLoginCompletion(); 285 StartLoginCompletion();
289 } else { 286 } else {
290 if (delegate_) 287 if (delegate_)
291 delegate_->WhiteListCheckFailed(username); 288 delegate_->WhiteListCheckFailed(username);
292 else 289 else
293 NOTREACHED(); 290 NOTREACHED();
294 } 291 }
295 } 292 }
296 } 293 }
297 294
(...skipping 21 matching lines...) Expand all
319 return; 316 return;
320 } 317 }
321 } 318 }
322 319
323 bool allow_new_user = false; 320 bool allow_new_user = false;
324 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); 321 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user);
325 if (ScreenLocker::default_screen_locker() || allow_new_user) { 322 if (ScreenLocker::default_screen_locker() || allow_new_user) {
326 // Starts authentication if guest login is allowed or online auth pending. 323 // Starts authentication if guest login is allowed or online auth pending.
327 StartAuthentication(); 324 StartAuthentication();
328 } else { 325 } else {
329 const base::ListValue *user_list; 326 if (cros_settings->FindEmailInList(kAccountsPrefUsers, username)) {
330 base::StringValue username_value(username);
331 if (cros_settings->GetList(kAccountsPrefUsers, &user_list) &&
332 user_list->Find(username_value) != user_list->end()) {
333 StartAuthentication(); 327 StartAuthentication();
334 } else { 328 } else {
335 if (delegate_) 329 if (delegate_)
336 delegate_->WhiteListCheckFailed(username); 330 delegate_->WhiteListCheckFailed(username);
337 else 331 else
338 NOTREACHED(); 332 NOTREACHED();
339 } 333 }
340 } 334 }
341 } 335 }
342 336
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 profile, 550 profile,
557 username_, 551 username_,
558 password_, 552 password_,
559 captcha_token_, 553 captcha_token_,
560 captcha_)); 554 captcha_));
561 } 555 }
562 password_.clear(); 556 password_.clear();
563 } 557 }
564 558
565 } // namespace chromeos 559 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698