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

Side by Side Diff: chrome/browser/signin/chrome_signin_client.cc

Issue 2478173003: Lock profile before sign in when force sign in is enabled. (Closed)
Patch Set: rogerta's comments Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/signin/chrome_signin_client.h" 5 #include "chrome/browser/signin/chrome_signin_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 // the new profile soon. 425 // the new profile soon.
426 should_display_user_manager_ = false; 426 should_display_user_manager_ = false;
427 } 427 }
428 } 428 }
429 429
430 void ChromeSigninClient::OnCloseBrowsersSuccess( 430 void ChromeSigninClient::OnCloseBrowsersSuccess(
431 const base::Callback<void()>& sign_out, 431 const base::Callback<void()>& sign_out,
432 const base::FilePath& profile_path) { 432 const base::FilePath& profile_path) {
433 SigninClient::PreSignOut(sign_out); 433 SigninClient::PreSignOut(sign_out);
434 434
435 LockProfile(profile_path); 435 LockForceSigninProfile(profile_path);
436 // After sign out, lock the profile and show UserManager if necessary. 436 // After sign out, lock the profile and show UserManager if necessary.
437 if (should_display_user_manager_) { 437 if (should_display_user_manager_) {
438 ShowUserManager(profile_path); 438 ShowUserManager(profile_path);
439 } else { 439 } else {
440 should_display_user_manager_ = true; 440 should_display_user_manager_ = true;
441 } 441 }
442 } 442 }
443 443
444 void ChromeSigninClient::OnCloseBrowsersAborted( 444 void ChromeSigninClient::OnCloseBrowsersAborted(
445 const base::FilePath& profile_path) { 445 const base::FilePath& profile_path) {
446 should_display_user_manager_ = true; 446 should_display_user_manager_ = true;
447 } 447 }
448 448
449 void ChromeSigninClient::LockProfile(const base::FilePath& profile_path) { 449 void ChromeSigninClient::LockForceSigninProfile(
450 const base::FilePath& profile_path) {
450 ProfileAttributesEntry* entry; 451 ProfileAttributesEntry* entry;
451 bool has_entry = 452 bool has_entry =
452 g_browser_process->profile_manager() 453 g_browser_process->profile_manager()
453 ->GetProfileAttributesStorage() 454 ->GetProfileAttributesStorage()
454 .GetProfileAttributesWithPath(profile_->GetPath(), &entry); 455 .GetProfileAttributesWithPath(profile_->GetPath(), &entry);
455 if (!has_entry) 456 if (!has_entry)
456 return; 457 return;
457 entry->SetIsSigninRequired(true); 458 entry->LockForceSigninProfile(true);
458 } 459 }
459 460
460 void ChromeSigninClient::ShowUserManager(const base::FilePath& profile_path) { 461 void ChromeSigninClient::ShowUserManager(const base::FilePath& profile_path) {
461 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) 462 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
462 UserManager::Show(profile_path, profiles::USER_MANAGER_NO_TUTORIAL, 463 UserManager::Show(profile_path, profiles::USER_MANAGER_NO_TUTORIAL,
463 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); 464 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
464 #endif 465 #endif
465 } 466 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/chrome_signin_client.h ('k') | chrome/browser/signin/chrome_signin_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698