| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/profile_helper.h" | 5 #include "chrome/browser/ui/webui/profile_helper.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/lifetime/keep_alive_types.h" | 10 #include "chrome/browser/lifetime/keep_alive_types.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 Profile::CreateStatus status) { | 36 Profile::CreateStatus status) { |
| 37 if (status != Profile::CREATE_STATUS_INITIALIZED) | 37 if (status != Profile::CREATE_STATUS_INITIALIZED) |
| 38 return; | 38 return; |
| 39 | 39 |
| 40 OpenNewWindowForProfile(profile); | 40 OpenNewWindowForProfile(profile); |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 void OpenNewWindowForProfile(Profile* profile) { | 45 void OpenNewWindowForProfile(Profile* profile) { |
| 46 if (signin::IsForceSigninEnabled()) { | 46 if (signin::IsForceSigninEnabled() || |
| 47 profiles::IsProfileLocked(profile->GetPath())) { |
| 47 if (!UserManager::IsShowing()) { | 48 if (!UserManager::IsShowing()) { |
| 48 UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, | 49 UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, |
| 49 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 50 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 50 } | 51 } |
| 51 | 52 |
| 52 g_browser_process->profile_manager()->CreateProfileAsync( | 53 g_browser_process->profile_manager()->CreateProfileAsync( |
| 53 ProfileManager::GetSystemProfilePath(), | 54 ProfileManager::GetSystemProfilePath(), |
| 54 base::Bind(&ShowSigninDialog, profile->GetPath()), base::string16(), | 55 base::Bind(&ShowSigninDialog, profile->GetPath()), base::string16(), |
| 55 std::string(), std::string()); | 56 std::string(), std::string()); |
| 56 | 57 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 70 return; | 71 return; |
| 71 g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion( | 72 g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion( |
| 72 file_path, base::Bind(&DeleteProfileCallback, | 73 file_path, base::Bind(&DeleteProfileCallback, |
| 73 base::Passed(base::MakeUnique<ScopedKeepAlive>( | 74 base::Passed(base::MakeUnique<ScopedKeepAlive>( |
| 74 KeepAliveOrigin::PROFILE_HELPER, | 75 KeepAliveOrigin::PROFILE_HELPER, |
| 75 KeepAliveRestartOption::DISABLED))), | 76 KeepAliveRestartOption::DISABLED))), |
| 76 deletion_source); | 77 deletion_source); |
| 77 } | 78 } |
| 78 | 79 |
| 79 } // namespace webui | 80 } // namespace webui |
| OLD | NEW |