| Index: chrome/browser/ui/webui/profile_helper.cc
|
| diff --git a/chrome/browser/ui/webui/profile_helper.cc b/chrome/browser/ui/webui/profile_helper.cc
|
| index 04bf70c1d48674c254e061abfb8d005d096f9794..217cfaf46579b33bdc9755ffa367ab447144a16c 100644
|
| --- a/chrome/browser/ui/webui/profile_helper.cc
|
| +++ b/chrome/browser/ui/webui/profile_helper.cc
|
| @@ -6,6 +6,8 @@
|
|
|
| #include "base/bind.h"
|
| #include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/lifetime/keep_alive_types.h"
|
| +#include "chrome/browser/lifetime/scoped_keep_alive.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/profiles/profile_metrics.h"
|
| #include "chrome/browser/profiles/profile_window.h"
|
| @@ -20,17 +22,25 @@
|
|
|
| namespace webui {
|
| namespace {
|
| +
|
| void ShowSigninDialog(base::FilePath signin_profile_path,
|
| Profile* system_profile,
|
| Profile::CreateStatus status) {
|
| UserManager::ShowSigninDialog(system_profile, signin_profile_path);
|
| }
|
|
|
| -} // namespace
|
| -void OpenNewWindowForProfile(Profile* profile, Profile::CreateStatus status) {
|
| +void DeleteProfileCallback(std::unique_ptr<ScopedKeepAlive> keep_alive,
|
| + Profile* profile,
|
| + Profile::CreateStatus status) {
|
| if (status != Profile::CREATE_STATUS_INITIALIZED)
|
| return;
|
|
|
| + OpenNewWindowForProfile(profile);
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +void OpenNewWindowForProfile(Profile* profile) {
|
| if (signin::IsForceSigninEnabled()) {
|
| if (!UserManager::IsShowing()) {
|
| UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL,
|
| @@ -57,7 +67,11 @@ void DeleteProfileAtPath(base::FilePath file_path,
|
| if (!profiles::IsMultipleProfilesEnabled())
|
| return;
|
| g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion(
|
| - file_path, base::Bind(&OpenNewWindowForProfile), deletion_source);
|
| + file_path, base::Bind(&DeleteProfileCallback,
|
| + base::Passed(base::MakeUnique<ScopedKeepAlive>(
|
| + KeepAliveOrigin::PROFILE_HELPER,
|
| + KeepAliveRestartOption::DISABLED))),
|
| + deletion_source);
|
| }
|
|
|
| } // namespace webui
|
|
|