| 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 "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 Profile::CreateStatus status) { | 64 Profile::CreateStatus status) { |
| 65 if (status != Profile::CREATE_STATUS_INITIALIZED) | 65 if (status != Profile::CREATE_STATUS_INITIALIZED) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 OpenNewWindowForProfile(profile); | 68 OpenNewWindowForProfile(profile); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace | 71 } // namespace |
| 72 | 72 |
| 73 void OpenNewWindowForProfile(Profile* profile) { | 73 void OpenNewWindowForProfile(Profile* profile) { |
| 74 if (signin::IsForceSigninEnabled()) { | 74 if (profiles::IsProfileLocked(profile->GetPath())) { |
| 75 ShowUserManager(base::Bind(&ShowSigninDialog, profile->GetPath())); | 75 if (signin::IsForceSigninEnabled()) { |
| 76 } else if (profiles::IsProfileLocked(profile->GetPath())) { | 76 ShowUserManager(base::Bind(&ShowSigninDialog, profile->GetPath())); |
| 77 ShowUserManager(base::Bind(&ShowReauthDialog, GetProfileUserName(profile))); | 77 } else { |
| 78 ShowUserManager( |
| 79 base::Bind(&ShowReauthDialog, GetProfileUserName(profile))); |
| 80 } |
| 78 } else { | 81 } else { |
| 79 profiles::FindOrCreateNewWindowForProfile( | 82 profiles::FindOrCreateNewWindowForProfile( |
| 80 profile, chrome::startup::IS_PROCESS_STARTUP, | 83 profile, chrome::startup::IS_PROCESS_STARTUP, |
| 81 chrome::startup::IS_FIRST_RUN, false); | 84 chrome::startup::IS_FIRST_RUN, false); |
| 82 } | 85 } |
| 83 } | 86 } |
| 84 | 87 |
| 85 void DeleteProfileAtPath(base::FilePath file_path, | 88 void DeleteProfileAtPath(base::FilePath file_path, |
| 86 content::WebUI* web_ui, | 89 content::WebUI* web_ui, |
| 87 ProfileMetrics::ProfileDelete deletion_source) { | 90 ProfileMetrics::ProfileDelete deletion_source) { |
| 88 DCHECK(web_ui); | 91 DCHECK(web_ui); |
| 89 | 92 |
| 90 if (!profiles::IsMultipleProfilesEnabled()) | 93 if (!profiles::IsMultipleProfilesEnabled()) |
| 91 return; | 94 return; |
| 92 g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion( | 95 g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion( |
| 93 file_path, base::Bind(&DeleteProfileCallback, | 96 file_path, base::Bind(&DeleteProfileCallback, |
| 94 base::Passed(base::MakeUnique<ScopedKeepAlive>( | 97 base::Passed(base::MakeUnique<ScopedKeepAlive>( |
| 95 KeepAliveOrigin::PROFILE_HELPER, | 98 KeepAliveOrigin::PROFILE_HELPER, |
| 96 KeepAliveRestartOption::DISABLED))), | 99 KeepAliveRestartOption::DISABLED))), |
| 97 deletion_source); | 100 deletion_source); |
| 98 } | 101 } |
| 99 | 102 |
| 100 } // namespace webui | 103 } // namespace webui |
| OLD | NEW |