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

Unified Diff: chrome/browser/profiles/profile_manager.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: forgot untracked files Created 7 years, 6 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_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 19f2279885a975149db650e981332b70d70c6cfc..4662a766ebee165770e1581118a75622be8cb12c 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -165,6 +165,22 @@ void QueueProfileDirectoryForDeletion(const base::FilePath& path) {
ProfilesToDelete().push_back(path);
}
+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) {
+ ProfileManager::FindOrCreateNewWindowForProfile(
+ profile,
+ chrome::startup::IS_NOT_PROCESS_STARTUP,
+ chrome::startup::IS_NOT_FIRST_RUN,
+ desktop_type,
+ always_create);
+ }
+}
+
#if defined(OS_CHROMEOS)
void CheckCryptohomeIsMounted(chromeos::DBusMethodCallStatus call_status,
bool is_mounted) {
@@ -628,6 +644,21 @@ void ProfileManager::FindOrCreateNewWindowForProfile(
#endif // defined(OS_IOS)
}
+// static
+void ProfileManager::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);
+}
+
void ProfileManager::Observe(
int type,
const content::NotificationSource& source,

Powered by Google App Engine
This is Rietveld 408576698