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

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: clean up JS code 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..8cbc3a269acdc95b847b7dcaad73c26cffa938a6 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,
Nikita (slow) 2013/06/11 18:22:16 nit: parameters need to be aligned
noms 2013/06/12 20:41:54 Done.
+ 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,22 @@ void ProfileManager::FindOrCreateNewWindowForProfile(
#endif // defined(OS_IOS)
}
+// static
+void ProfileManager::SwitchToProfile(
+ const base::FilePath& path,
+ chrome::HostDesktopType desktop_type,
+ bool always_create) {
+
Nikita (slow) 2013/06/11 18:22:16 nit: drop empty line
noms 2013/06/12 20:41:54 Done.
+ 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