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

Unified Diff: chrome/browser/ui/webui/profile_helper.cc

Issue 2392953002: Display signin dialog for the default profile after the last profile being deleted. (Closed)
Patch Set: sky's comments Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d7a6881638c82fc6c181bc7dc0974b577b0adf0d..61a0d3a775bbb675e34f4702198c6be0d8650a0d 100644
--- a/chrome/browser/ui/webui/profile_helper.cc
+++ b/chrome/browser/ui/webui/profile_helper.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/ui/webui/profile_helper.h"
+
#include "base/bind.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -9,21 +11,45 @@
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/webui/profile_helper.h"
+#include "chrome/browser/ui/user_manager.h"
+#include "chrome/browser/ui/webui/signin/signin_utils.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
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) {
if (status != Profile::CREATE_STATUS_INITIALIZED)
return;
- profiles::FindOrCreateNewWindowForProfile(
- profile, chrome::startup::IS_PROCESS_STARTUP,
- chrome::startup::IS_FIRST_RUN, false);
+ if (signin::IsForceSigninEnabled()) {
+// TODO(zmin): Remove the switcher once the UserManager API is finished on Mac.
+#if !defined(OS_MACOSX)
sky 2016/10/06 16:02:08 Is it expected this branch (force signin enabled)
+ if (!UserManager::IsShowing()) {
+ UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL,
+ profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION);
+ }
+
+ g_browser_process->profile_manager()->CreateProfileAsync(
+ ProfileManager::GetSystemProfilePath(),
+ base::Bind(&ShowSigninDialog, profile->GetPath()), base::string16(),
+ std::string(), std::string());
+
+#endif
+ } else {
+ profiles::FindOrCreateNewWindowForProfile(
+ profile, chrome::startup::IS_PROCESS_STARTUP,
+ chrome::startup::IS_FIRST_RUN, false);
+ }
}
void DeleteProfileAtPath(base::FilePath file_path,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698