diff options
Diffstat (limited to 'chrome/browser/profiles/profile_window.h')
-rw-r--r-- | chrome/browser/profiles/profile_window.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/profiles/profile_window.h b/chrome/browser/profiles/profile_window.h index 77fc4e2..f674144 100644 --- a/chrome/browser/profiles/profile_window.h +++ b/chrome/browser/profiles/profile_window.h @@ -5,6 +5,7 @@ #ifndef CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ #define CHROME_BROWSER_PROFILES_PROFILE_WINDOW_H_ +#include "base/callback_forward.h" #include "chrome/browser/ui/host_desktop.h" #include "chrome/browser/ui/startup/startup_types.h" @@ -13,6 +14,9 @@ namespace base { class FilePath; } namespace profiles { +// Callback to be used when switching to a new profile is completed. +typedef base::Callback<void()> ProfileSwitchingDoneCallback; + // Activates a window for |profile| on the desktop specified by // |desktop_type|. If no such window yet exists, or if |always_create| is // true, this first creates a new window, then activates @@ -28,15 +32,24 @@ void FindOrCreateNewWindowForProfile( // Opens a Browser with the specified profile given by |path|. // If |always_create| is true then a new window is created -// even if a window for that profile already exists. +// even if a window for that profile already exists. When the browser is +// opened, |callback| will be run if it isn't null. + void SwitchToProfile( const base::FilePath& path, chrome::HostDesktopType desktop_type, - bool always_create); + bool always_create, + ProfileSwitchingDoneCallback callback); + +// Opens a Browser for the guest profile and runs |callback| if it isn't null. +void SwitchToGuestProfile(chrome::HostDesktopType desktop_type, + ProfileSwitchingDoneCallback callback); // Creates a new profile from the next available profile directory, and -// opens a new browser window for the profile once it is ready. -void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type); +// opens a new browser window for the profile once it is ready. When the browser +// is opened, |callback| will be run if it isn't null. +void CreateAndSwitchToNewProfile(chrome::HostDesktopType desktop_type, + ProfileSwitchingDoneCallback callback); // Closes all browser windows that belong to the guest profile. void CloseGuestProfileWindows(); |