| 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 "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/lifetime/keep_alive_types.h" | 9 #include "chrome/browser/lifetime/keep_alive_types.h" |
| 10 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 10 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
| 11 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
| 12 #include "chrome/browser/profiles/profile_metrics.h" | 12 #include "chrome/browser/profiles/profile_metrics.h" |
| 13 #include "chrome/browser/profiles/profile_window.h" | 13 #include "chrome/browser/profiles/profile_window.h" |
| 14 #include "chrome/browser/profiles/profiles_state.h" | 14 #include "chrome/browser/profiles/profiles_state.h" |
| 15 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
| 16 #include "chrome/browser/ui/user_manager.h" | 16 #include "chrome/browser/ui/user_manager.h" |
| 17 #include "chrome/browser/ui/webui/signin/signin_utils.h" | 17 #include "chrome/browser/ui/webui/signin/signin_utils.h" |
| 18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/browser/web_ui.h" | 19 #include "content/public/browser/web_ui.h" |
| 20 #include "extensions/browser/app_window/app_window.h" | 20 #include "extensions/browser/app_window/app_window.h" |
| 21 #include "extensions/browser/app_window/app_window_registry.h" | 21 #include "extensions/browser/app_window/app_window_registry.h" |
| 22 | 22 |
| 23 namespace webui { | 23 namespace webui { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 void ShowSigninDialog(base::FilePath signin_profile_path, | 26 void ShowSigninDialog(base::FilePath signin_profile_path, |
| 27 Profile* system_profile, | 27 Profile* system_profile, |
| 28 Profile::CreateStatus status) { | 28 Profile::CreateStatus status) { |
| 29 UserManager::ShowSigninDialog(system_profile, signin_profile_path); | 29 UserManagerProfileDialog::ShowSigninDialog(system_profile, |
| 30 signin_profile_path); |
| 30 } | 31 } |
| 31 | 32 |
| 32 void DeleteProfileCallback(std::unique_ptr<ScopedKeepAlive> keep_alive, | 33 void DeleteProfileCallback(std::unique_ptr<ScopedKeepAlive> keep_alive, |
| 33 Profile* profile, | 34 Profile* profile, |
| 34 Profile::CreateStatus status) { | 35 Profile::CreateStatus status) { |
| 35 if (status != Profile::CREATE_STATUS_INITIALIZED) | 36 if (status != Profile::CREATE_STATUS_INITIALIZED) |
| 36 return; | 37 return; |
| 37 | 38 |
| 38 OpenNewWindowForProfile(profile); | 39 OpenNewWindowForProfile(profile); |
| 39 } | 40 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 68 return; | 69 return; |
| 69 g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion( | 70 g_browser_process->profile_manager()->MaybeScheduleProfileForDeletion( |
| 70 file_path, base::Bind(&DeleteProfileCallback, | 71 file_path, base::Bind(&DeleteProfileCallback, |
| 71 base::Passed(base::MakeUnique<ScopedKeepAlive>( | 72 base::Passed(base::MakeUnique<ScopedKeepAlive>( |
| 72 KeepAliveOrigin::PROFILE_HELPER, | 73 KeepAliveOrigin::PROFILE_HELPER, |
| 73 KeepAliveRestartOption::DISABLED))), | 74 KeepAliveRestartOption::DISABLED))), |
| 74 deletion_source); | 75 deletion_source); |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace webui | 78 } // namespace webui |
| OLD | NEW |