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

Unified Diff: chrome/browser/profiles/profile_window.cc

Issue 16104008: First try at a user management screen for the desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix linux CrOS browser test Created 7 years, 5 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
Index: chrome/browser/profiles/profile_window.cc
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index fb3276fa93033fbdf624f2f9da36c3e96792ed37..55230873d25e824773b231c6c594572d58b952bf 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -6,8 +6,11 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/user_metrics.h"
#if !defined(OS_IOS)
@@ -16,8 +19,29 @@
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#endif // !defined (OS_IOS)
+using content::BrowserThread;
using content::UserMetricsAction;
+namespace {
+
+void OpenBrowserWindowForProfile(bool always_create,
+ chrome::HostDesktopType desktop_type,
+ Profile* profile,
+ Profile::CreateStatus status) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+
+ if (status == Profile::CREATE_STATUS_INITIALIZED) {
+ profiles::FindOrCreateNewWindowForProfile(
+ profile,
+ chrome::startup::IS_NOT_PROCESS_STARTUP,
+ chrome::startup::IS_NOT_FIRST_RUN,
+ desktop_type,
+ always_create);
+ }
+}
+
+} // namespace
+
namespace profiles {
void FindOrCreateNewWindowForProfile(
@@ -48,4 +72,18 @@ void FindOrCreateNewWindowForProfile(
#endif // defined(OS_IOS)
}
+void SwitchToProfile(
+ const base::FilePath& path,
+ chrome::HostDesktopType desktop_type,
+ bool always_create) {
+ g_browser_process->profile_manager()->CreateProfileAsync(
+ path,
+ base::Bind(&OpenBrowserWindowForProfile,
+ always_create,
+ desktop_type),
+ string16(),
+ string16(),
+ false);
+}
+
} // namespace profiles
« no previous file with comments | « chrome/browser/profiles/profile_window.h ('k') | chrome/browser/resources/chromeos/login/display_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698